Fix group lives; resolves #384 and resolves #440

This commit is contained in:
Daniel Saukel 2018-07-13 22:38:48 +02:00
parent 7c15214c87
commit 07b68397f3

View File

@ -864,7 +864,8 @@ public class DGamePlayer extends DInstancePlayer {
}
if (getDGroup() != null && dGroup.getLives() != -1) {
dGroup.setLives(dGroup.getLives() - dPlayerDeathEvent.getLostLives());
int newLives = dGroup.getLives() - dPlayerDeathEvent.getLostLives();
dGroup.setLives(newLives < 0 ? 0 : newLives);// If the group already has 0 lives, don't remove any
gameWorld.sendMessage(DMessage.GROUP_DEATH.getMessage(getName(), dGroup.getName(), String.valueOf(dGroup.getLives())));
} else {