@@ -207,10 +207,21 @@ public void ExtAiStartState(NpcInstance npc, int action, bool stopCurrentState,
207207 {
208208 var other = ( NpcInstance ) _gameStateService . GothicVm . GlobalOther ;
209209 var victim = ( NpcInstance ) _gameStateService . GothicVm . GlobalOther ;
210-
211- npc . GetUserData ( ) . Props . AnimationQueue . Enqueue ( new StartState (
210+
211+ var container = npc . GetUserData ( ) ;
212+
213+ if ( stopCurrentState )
214+ {
215+ // Abandon current state immediately so the new one starts next frame, not after the whole queue drains.
216+ container . PrefabProps ? . AiHandler ? . ClearState ( false ) ;
217+ container . Props . StateEnd = 0 ;
218+ container . Props . CurrentWayPoint = null ; // forces GoToWp to use nearest WP, not stale pre-interrupt WP
219+
220+ }
221+
222+ container . Props . AnimationQueue . Enqueue ( new StartState (
212223 new AnimationAction ( int0 : action , bool0 : stopCurrentState , string0 : wayPointName , instance0 : other , instance1 : victim ) ,
213- npc . GetUserData ( ) ) ) ;
224+ container ) ) ;
214225 }
215226
216227 public void ExtAiLookAt ( NpcInstance npc , string wayPointName )
@@ -259,7 +270,10 @@ public void ExtAiStandUp(NpcInstance npc)
259270 // FIXME - Implement remaining tasks from G1 documentation:
260271 // * Ist der Nsc in einem Animatinsstate, wird die passende Rücktransition abgespielt.
261272 // * Benutzt der NSC gerade ein MOBSI, poppt er ins stehen.
262- npc . GetUserData ( ) . Props . AnimationQueue . Enqueue ( new StandUp ( new AnimationAction ( ) , npc . GetUserData ( ) ) ) ;
273+ var container = npc . GetUserData ( ) ;
274+ // Reset immediately (not via queue) so Daedalus C_BodyStateContains checks in the same ZS_*_Loop tick see BsStand.
275+ container . Props . BodyState = VmGothicEnums . BodyState . BsStand ;
276+ container . Props . AnimationQueue . Enqueue ( new StandUp ( new AnimationAction ( ) , container ) ) ;
263277 }
264278
265279 public void ExtAiTurnToNpc ( NpcInstance npc , NpcInstance other )
0 commit comments