Fixed RealignFamiliars() -- Caboose wasn't correctly proofed

This commit is contained in:
UndeadMaelys 2021-01-06 06:41:26 +01:00
parent f064767bad
commit d5011aabc4
1 changed files with 9 additions and 7 deletions

View File

@ -85,14 +85,16 @@ local function RealignFamiliars()
local Caboose = nil
for _, entity in pairs(Isaac.GetRoomEntities()) do
if entity.Type == EntityType.ENTITY_FAMILIAR and entity.Child == nil then
Caboose = entity
else
if Caboose.FrameCount < entity.FrameCount then
Caboose.Parent = entity
entity.Child = Caboose
if Caboose == nil then
Caboose = entity
else
Caboose.Child = entity
entity.Parent = Caboose
if Caboose.FrameCount < entity.FrameCount then
Caboose.Parent = entity
entity.Child = Caboose
else
Caboose.Child = entity
entity.Parent = Caboose
end
end
end
end