Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use a time limit for non-daily routine states #648

Merged
merged 2 commits into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions game/world/objects/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2245,7 +2245,8 @@ void Npc::nextAiAction(AiQueue& queue, uint64_t dt) {
}
break;
case AI_StartState:
if(startState(act.func,act.s0,aiState.eTime,act.i0==0)) {
// only daily routine states have a scheduled end time
if(startState(act.func,act.s0,gtime::endOfTime(),act.i0==0)) {
setOther(act.target);
setVictum(act.victum);
}
Expand Down Expand Up @@ -2699,11 +2700,9 @@ void Npc::tickRoutine() {
loop = owner.version().hasZSStateLoop() ? 1 : 0;
}

if(aiState.eTime<=owner.time()) {
if(!isTalk()) {
loop = LOOP_END; // have to hack ZS_Talk bugs
}
}
if(aiState.eTime<=owner.time())
loop = LOOP_END;

if(loop!=LOOP_CONTINUE) {
clearState(false);
currentOther = nullptr;
Expand Down