Added StackOverflow safeguards for dealDamage invocations Fixes #5129 Fixes #5029 Fixes #5186

This commit is contained in:
nossr50
2025-06-07 15:15:09 -07:00
parent 5e9ee1e275
commit 3d16d9432d
8 changed files with 84 additions and 75 deletions

View File

@@ -159,7 +159,8 @@ public class WoodcuttingManager extends SkillManager {
double health = player.getHealth();
if (health > 1) {
CombatUtils.dealDamage(player, Misc.getRandom().nextInt((int) (health - 1)));
int dmg = Misc.getRandom().nextInt((int) (health - 1));
CombatUtils.safeDealDamage(player, dmg);
}
return;