From f42a28f34f688f4025c4e8688a14264693be9c09 Mon Sep 17 00:00:00 2001 From: GJ Date: Thu, 25 Apr 2013 19:26:30 -0400 Subject: [PATCH] Use defaults in case these are null. --- .../nossr50/datatypes/player/PlayerProfile.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java index ba65ba0f2..4c9ab2245 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/PlayerProfile.java @@ -400,12 +400,12 @@ public class PlayerProfile { out.append("0:"); // DATS out.append("0:"); // DATS out.append("0:"); // DATS - out.append(hudType.toString()).append(":"); // HUD + out.append(hudType == null ? "STANDARD" : hudType.toString()).append(":"); // HUD out.append("0:"); // Fishing out.append("0:"); // FishingXp out.append("0:"); // Blast Mining out.append(String.valueOf(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)).append(":"); // LastLogin - out.append(mobHealthbarType.toString()).append(":"); // Mob Healthbar HUD + out.append(mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()).append(":"); // Mob Healthbar HUD // Add more in the same format as the line above @@ -488,8 +488,8 @@ public class PlayerProfile { SQLDatabaseManager.write("UPDATE " + tablePrefix + "users SET lastlogin = " + ((int) (System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR)) + " WHERE id = " + userId); SQLDatabaseManager.write("UPDATE " + tablePrefix + "huds SET " - + " hudtype = " + hudType.toString() - + ", mobhealthbar = " + mobHealthbarType.toString() + + " hudtype = " + (hudType == null ? "STANDARD" : hudType.toString()) + + ", mobhealthbar = " + (mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()) + " WHERE user_id = " + userId); SQLDatabaseManager.write("UPDATE " + tablePrefix + "cooldowns SET " + " mining = " + skillsDATS.get(AbilityType.SUPER_BREAKER) @@ -580,12 +580,12 @@ public class PlayerProfile { writer.append(skillsDATS.get(AbilityType.SERRATED_STRIKES)).append(":"); writer.append(skillsDATS.get(AbilityType.SKULL_SPLITTER)).append(":"); writer.append(skillsDATS.get(AbilityType.SUPER_BREAKER)).append(":"); - writer.append(hudType.toString()).append(":"); + writer.append(hudType == null ? "STANDARD" : hudType.toString()).append(":"); writer.append(skills.get(SkillType.FISHING)).append(":"); writer.append(getSkillXpLevel(SkillType.FISHING)).append(":"); writer.append(skillsDATS.get(AbilityType.BLAST_MINING)).append(":"); writer.append(System.currentTimeMillis() / Misc.TIME_CONVERSION_FACTOR).append(":"); - writer.append(mobHealthbarType.toString()).append(":"); + writer.append(mobHealthbarType == null ? Config.getInstance().getMobHealthbarDefault().toString() : mobHealthbarType.toString()).append(":"); writer.append("\r\n"); } }