diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index bb3fc678..59218d2e 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -1964,7 +1964,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return true; } - public updateRoomObjectFloor(roomId: number, objectId: number, location: IVector3D, direction: IVector3D, state: number, data: IObjectData, extra: number = NaN): boolean + public updateRoomObjectFloor(roomId: number, objectId: number, location: IVector3D, direction: IVector3D, state: number, data: IObjectData, extra: number = null): boolean { const object = this.getRoomObjectFloor(roomId, objectId); diff --git a/src/nitro/room/messages/ObjectDataUpdateMessage.ts b/src/nitro/room/messages/ObjectDataUpdateMessage.ts index 3ca56b4a..ef503355 100644 --- a/src/nitro/room/messages/ObjectDataUpdateMessage.ts +++ b/src/nitro/room/messages/ObjectDataUpdateMessage.ts @@ -7,7 +7,7 @@ export class ObjectDataUpdateMessage extends RoomObjectUpdateMessage private _data: IObjectData; private _extra: number; - constructor(state: number, data: IObjectData, extra: number = NaN) + constructor(state: number, data: IObjectData, extra: number = null) { super(null, null); @@ -30,4 +30,4 @@ export class ObjectDataUpdateMessage extends RoomObjectUpdateMessage { return this._extra; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureIceStormLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureIceStormLogic.ts index f3a5e425..3d41f51f 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureIceStormLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureIceStormLogic.ts @@ -49,8 +49,8 @@ export class FurnitureIceStormLogic extends FurnitureMultiStateLogic { if(!message) return; - const state = message.state / 1000; - const time = message.state % 1000; + const state = ~~(message.state / 1000); + const time = ~~(message.state % 1000); if(!time) { diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index 46ad42fb..ffd199c9 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -254,7 +254,7 @@ export class FurnitureLogic extends MovingObjectLogic if(message.data) message.data.writeRoomObjectModel(this.object.model); - if(!isNaN(message.extra)) this.object.model.setValue(RoomObjectVariable.FURNITURE_EXTRAS, message.extra.toString()); + if(message.extra !== null) this.object.model.setValue(RoomObjectVariable.FURNITURE_EXTRAS, message.extra.toString()); this.object.model.setValue(RoomObjectVariable.FURNITURE_STATE_UPDATE_TIME, this.lastUpdateTime); }