Overflow Crash When Summoning Zombie
MokahTGS opened this issue ยท 3 comments
Minecraft version: 1.12.2
Wizardry version: 4.1.2 [change as necessary]
Environment: Singleplayer/Hosted LAN game
Issue details: Used a Summon Zombie Scroll and the game lagged up and then crashed.
Other mods involved: https://pastebin.com/9DPrNDcX
Link to crash report (if applicable): https://pastebin.com/zvYkF4FH
That issue above prompted me to investigate this one further, and I have found the source of the problem.
As I suspect is also the case with the other issue, both wizardry and another mod (in this case Loot Slash Conquer) modify damage using events, then re-apply it. Without a check against infinite looping, this causes a StackOverflowError - so both wizardry and LSC have implemented their own checks which essentially involve 'marking' the damage as re-applied. However, the mods still don't check for each other's 'markers', so in certain cases an infinite loop can still occur back and forth between the two mods.
Personally I think this is a bit of an oversight in Forge - it would be far better if we could change damage attributes directly without having to cancel the original and re-apply it. However, as I said in the other issue thread, I should be able to do an if-all-else-fails fix where wizardry detects excessive looping and diverts its own methods to avert a crash. This will result in a slight loss of functionality when it happens (specifically, you won't get xp from a summoned creature kill if it would have caused a crash).
Seems to be as soon as it's summoned, but I don't know if it's trying to target something outside.