The-International-Open-Source
The-International-Open-Source copied to clipboard
commune abandonment
- If there is a terminal, try to send away the most valuable resources until we are basically out of energy. Then unclaim
- Otherwise if there is a storage, make a haulRequest to take from the room. If no responders take on the request the next tick, unclaim
- If there are no storing structures then unclaim immediately
@CarsonBurke there is an issue with the current commune abandonment implementation I found out by using the abandon flag on a few bad rooms of mine. You have to delete the room from the Memory, otherwise, it runs into an error the next tick due to all of the managers accessing it because of looping through Memory.rooms
.
I told Panda the fix already in this thread: https://discord.com/channels/978303052933115925/1075753172708118548
But here it is again. Instead of this:
if (room.memory.Ab) {
room.controller.unclaim()
return
}
also do this:
if (room.memory.Ab) {
room.controller.unclaim()
if (Memory.rooms[room.name]) {
delete Memory.rooms[room.name]
}
return
}
File to edit for this fix: https://github.com/The-International-Screeps-Bot/The-International-Open-Source/blob/Development/src/room/commune/commune.ts#L131
Also when you abandon a room like that. You should remove its construction sites because they get stored in the memory. Found this, but it doesn't cover this case. https://github.com/The-International-Screeps-Bot/The-International-Open-Source/blob/Development/src/international/constructionSiteManager.ts#L7
The above solution doesn't seem to be enough. Map visuals show the abandoned rooms like they are still used.
Latest commit should fix, please confirm is possible