Skip to content

Commit

Permalink
Level can't be <0; resolves #871 and #884
Browse files Browse the repository at this point in the history
  • Loading branch information
Sataniel98 committed Sep 2, 2020
1 parent 7c7b61b commit 7e79b52
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,8 @@ public void onDeath(PlayerDeathEvent event) {
int expDrop = 7 * player.getLevel();
expDrop = expDrop > 100 ? 100 : expDrop;
orb.setExperience(expDrop);
player.setLevel(player.getLevel() - 7);
int newLevel = player.getLevel() - 7;
player.setLevel(newLevel > 0 ? newLevel : 0);
player.setExp(0);
}

Expand Down

0 comments on commit 7e79b52

Please sign in to comment.