Fix act for scripts that reset to initial state after some time

This commit is contained in:
P0nk
2022-08-29 22:46:46 +02:00
parent 17ae269cc9
commit 7fa677d766
4 changed files with 8 additions and 5 deletions

View File

@@ -270,8 +270,11 @@ public class Reactor extends AbstractMapObject {
continue;
}
}
state = stats.getNextState(state, b);
if (stats.getNextState(state, b) == -1) {//end of reactor
this.state = stats.getNextState(state, b);
byte nextState = stats.getNextState(state, b);
boolean isInEndState = nextState < this.state;
if (isInEndState) {//end of reactor
if (reactorType < 100) {//reactor broken
if (delay > 0) {
map.destroyReactor(getObjectId());