TeamREPENTOGON / REPENTOGON

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

[rep+] EntityBomb:SetScale()/EntityBomb:SetLoadCostumes() Not working with MC_POST_PLAYER_USE_BOMB #636

Closed Kakoure closed 1 week ago

Kakoure commented 1 week ago

I have the following function for resizing bombs to appear visually smaller which is called in two situations:

ModCallbacks.MC_POST_PLAYER_USE_BOMB: Passes both the player and the bomb, used when placing the bomb manually. ModCallbacks.MC_POST_FIRE_BOMB: Gets the player from the bomb's SpawnerEntity and passes both to the function, used when firing bombs from items such as Dr. Fetus

In the non Rep+ build of rgon, the bomb will scale down appropriately in both situations. In the current nightly Rep+ build (just installed it today), the bomb will only scale down when fired from MC_POST_FIRE_BOMB (Dr. Fetus shots), not when placed manually. Placing log statements in the function shows that bomb:SetScale(.75) is being reached from both callbacks, and setting other properties such as bomb.RadiusMultiplier within the function also appears to work for both callbacks. It is just the scaling that doesn't seem to take effect when triggered from MC_POST_PLAYER_USE_BOMB.

The function in question is as shown below:

function Character:MinisaacSmallBombs(player, bomb)
    if player:GetPlayerType() == MechUtil.Players.MINISAAC then
        bomb:SetScale(.75)
        bomb:SetLoadCostumes(true)
    end
end
Kakoure commented 1 week ago

One more finding that is related to this issue is that the bomb costumes with custom bomb variants set through bombcostumes.xml also do not appear when triggered through MC_POST_PLAYER_USE_BOMB, but do when triggered through MC_POST_FIRE_BOMB. Could just be an issue with the SetLoadCostumes function specifically.

ConnorForan commented 1 week ago

Yeah, turns out the core issue was just SetLoadCostumes was not working.

Should be fixed in https://github.com/TeamREPENTOGON/REPENTOGON/commit/901422e1f10cf1ed4d8cf3ecaf3efb94af3c30e1