diff --git a/src/declarations/memory.d.ts b/src/declarations/memory.d.ts index b6c0c704d..aff579543 100644 --- a/src/declarations/memory.d.ts +++ b/src/declarations/memory.d.ts @@ -169,7 +169,7 @@ interface RoomMemory { avoid?: boolean; src?: SavedSource[]; ctrl?: SavedController | undefined; - mnrl: SavedMineral | undefined; + mnrl?: SavedMineral | undefined; SKlairs?: SavedRoomObject[]; importantStructs?: { // Positions of important structures relevant to sieges diff --git a/src/intel/RoomIntel.ts b/src/intel/RoomIntel.ts index 70eff6b75..34de632d3 100644 --- a/src/intel/RoomIntel.ts +++ b/src/intel/RoomIntel.ts @@ -225,6 +225,9 @@ export class RoomIntel { } static getSafetyData(roomName: string): SafetyData { + if (!Memory.rooms[roomName]) { + Memory.rooms[roomName] = {}; + } if (!Memory.rooms[roomName].safety) { Memory.rooms[roomName].safety = { safeFor : 0,