Merge pull request #1368 from thecodingmachine/fix_zone_enter_exit
Fixing enter/leave event not properly sent on adjacent zones
This commit is contained in:
commit
06be65c12f
@ -927,9 +927,10 @@ export class GameScene extends DirtyScene {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.gameMap.onPropertyChange("zone", (newValue, oldValue) => {
|
this.gameMap.onPropertyChange("zone", (newValue, oldValue) => {
|
||||||
if (newValue === undefined || newValue === false || newValue === "") {
|
if (oldValue) {
|
||||||
iframeListener.sendLeaveEvent(oldValue as string);
|
iframeListener.sendLeaveEvent(oldValue as string);
|
||||||
} else {
|
}
|
||||||
|
if (newValue) {
|
||||||
iframeListener.sendEnterEvent(newValue as string);
|
iframeListener.sendEnterEvent(newValue as string);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1368,7 +1369,6 @@ ${escapedMessage}
|
|||||||
iframeListener.unregisterAnswerer("getState");
|
iframeListener.unregisterAnswerer("getState");
|
||||||
iframeListener.unregisterAnswerer("loadTileset");
|
iframeListener.unregisterAnswerer("loadTileset");
|
||||||
iframeListener.unregisterAnswerer("getMapData");
|
iframeListener.unregisterAnswerer("getMapData");
|
||||||
iframeListener.unregisterAnswerer("getState");
|
|
||||||
iframeListener.unregisterAnswerer("triggerActionMessage");
|
iframeListener.unregisterAnswerer("triggerActionMessage");
|
||||||
iframeListener.unregisterAnswerer("removeActionMessage");
|
iframeListener.unregisterAnswerer("removeActionMessage");
|
||||||
this.sharedVariablesManager?.close();
|
this.sharedVariablesManager?.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user