Level can't be <0; resolves #871 and #884

This commit is contained in:
Daniel Saukel 2020-09-02 02:26:31 +02:00
parent 7c7b61be0c
commit 7e79b52091

View File

@ -649,7 +649,8 @@ public class DGamePlayer extends DInstancePlayer implements GamePlayer {
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);
}