diff --git a/eid_api.lua b/eid_api.lua index 8494ea47..35841d35 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -1741,6 +1741,18 @@ function EID:evaluateTransformationProgress(transformation) end end +-- Create a list of all grid entities in the room that have an EID description +function EID:CheckCurrentRoomGridEntities() + EID.CurrentRoomGridEntities = {} + local room = game:GetRoom() + for i = 1, room:GetGridSize(), 1 do + local gridEntity = room:GetGridEntity(i) + if gridEntity and EID:hasDescription(gridEntity) then + EID.CurrentRoomGridEntities[i] = gridEntity + end + end +end + -- Workaround function to get the currently held pill of the players. Used to map Pill ID to pill color and vise versa EID.PlayerHeldPill = {} function EID:evaluateHeldPill() diff --git a/main.lua b/main.lua index f05ae17f..254dda28 100644 --- a/main.lua +++ b/main.lua @@ -746,18 +746,6 @@ if REPENTANCE then EID:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, EID.onNewRoomRep) end -function EID:CheckCurrentRoomGridEntities() - EID.CurrentRoomGridEntities = {} - local room = game:GetRoom() - for i = 1, room:GetGridSize(), 1 do - local gridEntity = room:GetGridEntity(i) - if gridEntity and EID:hasDescription(gridEntity) then - EID.CurrentRoomGridEntities[i] = gridEntity - end - end -end - --- On new room, save the status of any variables that need to be rewound upon Glowing Hourglass usage function EID:onNewRoom() EID:CheckCurrentRoomGridEntities() end