Skip to content

Commit 143bed3

Browse files
committed
working on ice-block fix
#906
1 parent 5447936 commit 143bed3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

game/world/objects/npc.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2795,8 +2795,11 @@ bool Npc::startState(ScriptFn id, std::string_view wp, gtime endTime, bool noFin
27952795
auto& st = owner.script().aiState(id);
27962796
// allowed player states are hard-coded
27972797
// https://forum.worldofplayers.de/forum/threads/1533803-G1-AI_StartState-hardcoded-ZS-states-for-Player?p=26034737&viewfull=1#post26034737
2798-
if(isPlayer() && !isPlayerEnabledState(st))
2799-
return false;
2798+
if(isPlayer() && !isPlayerEnabledState(st)) {
2799+
// disable for now, as it causes infinite lock in freeze state
2800+
// https://github.com/Try/OpenGothic/issues/906
2801+
//return false;
2802+
}
28002803

28012804
aiState.started = false;
28022805
aiState.funcIni = st.funcIni;
@@ -4070,7 +4073,7 @@ bool Npc::perceptionProcess(Npc &pl) {
40704073
}
40714074

40724075
bool Npc::perceptionProcess(Npc &pl, Npc* victim, float quadDist, PercType perc) {
4073-
if(!aiState.started) {
4076+
if(!aiState.started && aiState.funcIni.isValid()) {
40744077
// avoid ugly soft-lock (ZS_MM_Attack <-> B_MM_AssessWarn) for the orks near ramp
40754078
return false;
40764079
}

0 commit comments

Comments
 (0)