From ada5e7c8f409dbd7cea665a18c3e003fc969561f Mon Sep 17 00:00:00 2001 From: Daniel Scharrer Date: Thu, 21 Nov 2013 07:38:00 +0100 Subject: [PATCH] Don't repeatedly reset fight anim when near target This caused the animation to "stall" when the player moved directly in front of NPCs because a new animation was started on each update. Fixes: bug #270 --- src/game/NPC.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/game/NPC.cpp b/src/game/NPC.cpp index 42b207cfa3..d4d57737ba 100644 --- a/src/game/NPC.cpp +++ b/src/game/NPC.cpp @@ -2911,18 +2911,17 @@ static void ManageNPCMovement(Entity * io) if((io->_npcdata->behavior & (BEHAVIOUR_FIGHT | BEHAVIOUR_MAGIC | BEHAVIOUR_DISTANT)) && io->anims[ANIM_FIGHT_WAIT]) { - // TODO what is supposed to happen here ? if((ause0->cur_anim != alist[ANIM_FIGHT_WAIT]) && (ause0->cur_anim != alist[ANIM_FIGHT_STRAFE_LEFT]) && (ause0->cur_anim != alist[ANIM_FIGHT_STRAFE_RIGHT]) && (ause0->cur_anim != alist[ANIM_FIGHT_WALK_BACKWARD]) && (ause0->cur_anim != alist[ANIM_FIGHT_WALK_FORWARD]) - ) - + ) { AcquireLastAnim(io); FinishAnim(io, ause0->cur_anim); ANIM_Set(ause0, alist[ANIM_FIGHT_WAIT]); ause0->flags |= EA_LOOP; + } } else { // Stop it and put it in Wait anim after finishing his walk anim... if(ause0->cur_anim == alist[ANIM_FIGHT_WALK_FORWARD]) {