Fixing the retrieval of optional attributes

This commit is contained in:
bernatx 2022-11-24 11:39:25 +01:00 committed by bernat
parent 6625d66e78
commit 114a54d753
1 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ FActorSpawnResult AStaticMeshFactory::SpawnActor(
return {}; return {};
} }
float Scale = ABFL::ActorAttributeToFloat(ActorDescription.Variations["scale"], 1.0f); float Scale = ABFL::RetrieveActorAttributeToFloat("scale", ActorDescription.Variations, 1.0f);
FTransform ScaledTransform(SpawnAtTransform); FTransform ScaledTransform(SpawnAtTransform);
ScaledTransform.SetScale3D(FVector(Scale)); ScaledTransform.SetScale3D(FVector(Scale));
@ -73,7 +73,7 @@ FActorSpawnResult AStaticMeshFactory::SpawnActor(
if (ActorDescription.Variations.Contains("mass")) if (ActorDescription.Variations.Contains("mass"))
{ {
float Mass = ABFL::ActorAttributeToFloat(ActorDescription.Variations["mass"], 0.0f); float Mass = ABFL::RetrieveActorAttributeToFloat("mass", ActorDescription.Variations, 0.0f);
if (Mass > 0) if (Mass > 0)
{ {
StaticMeshComponent->SetMobility(EComponentMobility::Movable); StaticMeshComponent->SetMobility(EComponentMobility::Movable);