From 7af7f0ce28f53532d5fab29e0524e73f8556bedc Mon Sep 17 00:00:00 2001 From: Try Date: Sat, 8 Jun 2019 17:57:39 +0200 Subject: [PATCH] fix AI_StartState don't override state endTime, otherwise routine gona break --- Game/world/npc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Game/world/npc.cpp b/Game/world/npc.cpp index 90ac9cff8..1ac850505 100644 --- a/Game/world/npc.cpp +++ b/Game/world/npc.cpp @@ -1078,6 +1078,8 @@ void Npc::tick(uint64_t dt) { } else if(aiActions.size()==0) { tickRoutine(); + if(aiActions.size()>0) + nextAiAction(dt); return; } nextAiAction(dt); @@ -1142,7 +1144,7 @@ void Npc::nextAiAction(uint64_t dt) { aiActions.push_front(std::move(act)); break; case AI_StartState: - if(startState(act.func,act.s0,gtime::endOfTime(),act.i0==0)) + if(startState(act.func,act.s0,aiState.eTime,act.i0==0)) setOther(act.target); break; case AI_PlayAnim:{