From 8c11be5cdd13b0d7c01598d11189ee11e54ef3b4 Mon Sep 17 00:00:00 2001 From: kauron Date: Tue, 21 Jul 2015 00:52:26 +0200 Subject: [PATCH] PlayerEditor: fixed players not being saved --- .../com/kauron/dungeonmanager/PlayerEditor.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/kauron/dungeonmanager/PlayerEditor.java b/app/src/main/java/com/kauron/dungeonmanager/PlayerEditor.java index 713139b..aaf5a9d 100644 --- a/app/src/main/java/com/kauron/dungeonmanager/PlayerEditor.java +++ b/app/src/main/java/com/kauron/dungeonmanager/PlayerEditor.java @@ -124,19 +124,19 @@ public class PlayerEditor extends ActionBarActivity { if (!atk[i].getText().toString().isEmpty()) atkInts[i] = Integer.parseInt(atk[i].getText().toString()); boolean validAtk = true; - for (int i : atkInts) - if (i == 0) { + for (int i = Player.STR; i <= Player.CHA; i++) + if (atkInts[i] == 0) { validAtk = false; break; } if ( !nameString.isEmpty() && - classInt != Player.NULL && - raceInt != Player.NULL && - pxInt != -1 && - validAtk - ) { + classInt != Player.NULL && + raceInt != Player.NULL && + pxInt != -1 && + validAtk + ) { SharedPreferences p = getSharedPreferences(Welcome.PREFERENCES, MODE_PRIVATE); int i = p.getInt("players", 0); String saveName = nameString;