mirror of
https://github.com/garbagemule/MobArena.git
synced 2025-01-25 17:51:20 +01:00
Guard against null scores for players who manage to die in the lobby. Fixes #319
This commit is contained in:
parent
7e049cdae6
commit
acbeb3d77f
@ -62,12 +62,21 @@ public class ScoreboardManager {
|
|||||||
* @param player a player
|
* @param player a player
|
||||||
*/
|
*/
|
||||||
void death(Player player) {
|
void death(Player player) {
|
||||||
|
if (kills == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
String name = ChatColor.GRAY + player.getName();
|
String name = ChatColor.GRAY + player.getName();
|
||||||
if (name.length() > 16) {
|
if (name.length() > 16) {
|
||||||
name = name.substring(0, 15);
|
name = name.substring(0, 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
int value = kills.getScore(player).getScore();
|
Score score = kills.getScore(player);
|
||||||
|
if (score == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int value = score.getScore();
|
||||||
scoreboard.resetScores(player);
|
scoreboard.resetScores(player);
|
||||||
|
|
||||||
/* In case the player has no kills, they will not show up on the
|
/* In case the player has no kills, they will not show up on the
|
||||||
|
Loading…
Reference in New Issue
Block a user