TeamREPENTOGON / REPENTOGON

Script extender for The Binding of Isaac: Repentance
https://repentogon.com/
GNU General Public License v2.0
139 stars 16 forks source link

MC_POST_GRID_ENTITY_SPAWN doesn't seem to trigger for doors. #568

Open SlawekNowy opened 4 days ago

SlawekNowy commented 4 days ago
    function mod:postDevilDealDoorSpawn(gridEnt)
        --only doors past this point.
        local gridEntDoor = gridEnt:ToDoor();
        print(gridEnt:GetType());
        --last check handles duality.
        if gridEntDoor ~= nil and gridEntDoor.TargetRoomType == RoomType.ROOM_DEVIL and TSIL.Doors.GetAngelRoomDoor()==nil then
            music:PitchSlide(0.5)
        end

    end
    mod:AddCallback(ModCallbacks.MC_POST_GRID_ENTITY_SPAWN,mod.postDevilDealDoorSpawn);

Print is for debugging, note that not a single one returns 16. Are they handled somewhere else?

namishere commented 1 day ago

This callback had to be manually patched into existing code, in a lot of different places. It seems like I missed this case because of it not behaving the same as other grid entity spawning functions.