From 7e79b5209106735ceb8a406def64709703656b62 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Wed, 2 Sep 2020 02:26:31 +0200 Subject: [PATCH] Level can't be <0; resolves #871 and #884 --- .../main/java/de/erethon/dungeonsxl/player/DGamePlayer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/erethon/dungeonsxl/player/DGamePlayer.java b/core/src/main/java/de/erethon/dungeonsxl/player/DGamePlayer.java index 7e06b623..16db5ae9 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/player/DGamePlayer.java +++ b/core/src/main/java/de/erethon/dungeonsxl/player/DGamePlayer.java @@ -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); }