Terasology / Behaviors

Store for an assortment of behaviors that can be applied to creatures
https://terasology.github.io/Behaviors
6 stars 18 forks source link

fix: Prevent movement to origin after spawning #105

Closed skaldarnar closed 2 years ago

skaldarnar commented 2 years ago

The MinionMoveComponent#goalPosition was initialized with the default vector (0,0,0), causing the stray behavior to target this position as the first movement target.

As this origin location is usually not reachable when an entity is spawned, we wasted a couple of seconds for computing a path until we finally aborted as "not reachable".

With these changes, we can now distinguish between "no goal position" (null) and "explicit goal position" (any vector). We only attempt to find a path for non-null targets.