fixed bug where behavior would not continue after cutscene
This commit is contained in:
parent
d4a7de346d
commit
b42eb143f0
@ -31,7 +31,7 @@ class GameObject {
|
||||
|
||||
async doBehaviorEvent(map) {
|
||||
// stop if cutscene is playing
|
||||
if (map.isCutscenePlaying || this.behaviorLoop.length === 0) {
|
||||
if (map.isCutscenePlaying || this.behaviorLoop.length === 0 || this.isStanding) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,9 @@ class OverworldMap {
|
||||
}
|
||||
|
||||
this.isCutscenePlaying = false;
|
||||
|
||||
// reset npcs
|
||||
Object.values(this.gameObjects).forEach(object => object.doBehaviorEvent(this))
|
||||
}
|
||||
|
||||
addWall(x, y) {
|
||||
|
@ -2,6 +2,7 @@ class Person extends GameObject {
|
||||
constructor(config) {
|
||||
super(config);
|
||||
this.movementProgressRemaining = 0;
|
||||
this.isStanding = false;
|
||||
|
||||
this.isPlayerControlled = config.isPlayerControlled || false;
|
||||
|
||||
@ -50,10 +51,12 @@ class Person extends GameObject {
|
||||
}
|
||||
|
||||
if (behavior.type = "stand") {
|
||||
this.isStanding = true;
|
||||
setTimeout(() => {
|
||||
utils.emitEvent("PersonStandComplete", {
|
||||
whoId: this.id
|
||||
})
|
||||
this.isStanding = false;
|
||||
}, behavior.time);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user