(c8c4b0d92) Require that the bot is in the same hull as the goto target, before calling it done.

This commit is contained in:
Joonas Rikkonen
2019-06-04 16:40:23 +03:00
parent 25a74eb7f6
commit 7f5a6f77dd
4 changed files with 14 additions and 212 deletions
@@ -179,6 +179,10 @@ namespace Barotrauma
bool closeEnough = Vector2.DistanceSquared(Target.WorldPosition, character.WorldPosition) < CloseEnough * CloseEnough;
if (repeat)
{
if (closeEnough)
{
closeEnough = !(Target is Character) || Target is Character c && c.CurrentHull == character.CurrentHull;
}
if (closeEnough)
{
OnCompleted();