From 1e6252b6ab8a7ea6aa24fdd08df35faad95a22fb Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 12 Jul 2021 00:17:31 -0400 Subject: [PATCH] Fix busted furni logic --- .../room/object/logic/furniture/FurnitureLogic.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index ce836f53..215caef2 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -302,11 +302,6 @@ export class FurnitureLogic extends MovingObjectLogic this.eventDispatcher.dispatchEvent(mouseEvent); } - - if(this.eventDispatcher && this.object && this.contextMenu) - { - this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.OPEN_FURNI_CONTEXT_MENU, this.object)); - } return; case MouseEventType.MOUSE_DOWN: if(this.eventDispatcher) @@ -372,9 +367,11 @@ export class FurnitureLogic extends MovingObjectLogic public tearDown(): void { - if(this.widget && (this.object.model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT) === 1)) + if(this.object.model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT) === 1) { - this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.CLOSE_WIDGET, this.object)); + if(this.widget) this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.CLOSE_WIDGET, this.object)); + + if(this.contextMenu) this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.CLOSE_FURNI_CONTEXT_MENU, this.object)); } super.tearDown();