[1.20.1 Forge] Enable Attack feature for Elder Guardians can freeze the game permanently
TelepathicGrunt opened this issue ยท 1 comments
The issue is most noticeable with Bumblezone on as my Blue Sempiternal Sanctum's Calming Essence event spawns several Guardians and Elder Guardians for players to fight. As player kills the guardians, Progressive Bosses eventually will set getAttackDuration so low that getAttackAnimationScale will be too large and cause an infinite loop in vanilla code
TelepathicGrunt/Bumblezone#303
This is the vanilla code in question. Guardian class. aiStep method.
This is the mixin at fault (Also fyi, an inject that always cancels is just a silent overwrite that doesn't report conflicts. This is worse than just using an overwrite directly)
I threw in an inject to see what values was coming out of Progressive Bosses. getAttackDuration was being set to 35. Which caused getAttackAnimationScale to be 2.4. And because 2.4 is greater than 1.8, this means j is actually decreasing in value which means j can never be greater than h anymore. Thus the infinite loop that freezes the game permanently until restart.
In vanilla, getAttackAnimationScale is never greater than 1. This will need to be respected by Progressive Bosses to stop the infinite loop from happening again in the future.