1
0
Fork 0

PlayerEditor: fixed players not being saved

This commit is contained in:
kauron 2015-07-21 00:52:26 +02:00
parent f4d88a47e2
commit 8c11be5cdd

View file

@ -124,19 +124,19 @@ public class PlayerEditor extends ActionBarActivity {
if (!atk[i].getText().toString().isEmpty()) if (!atk[i].getText().toString().isEmpty())
atkInts[i] = Integer.parseInt(atk[i].getText().toString()); atkInts[i] = Integer.parseInt(atk[i].getText().toString());
boolean validAtk = true; boolean validAtk = true;
for (int i : atkInts) for (int i = Player.STR; i <= Player.CHA; i++)
if (i == 0) { if (atkInts[i] == 0) {
validAtk = false; validAtk = false;
break; break;
} }
if ( if (
!nameString.isEmpty() && !nameString.isEmpty() &&
classInt != Player.NULL && classInt != Player.NULL &&
raceInt != Player.NULL && raceInt != Player.NULL &&
pxInt != -1 && pxInt != -1 &&
validAtk validAtk
) { ) {
SharedPreferences p = getSharedPreferences(Welcome.PREFERENCES, MODE_PRIVATE); SharedPreferences p = getSharedPreferences(Welcome.PREFERENCES, MODE_PRIVATE);
int i = p.getInt("players", 0); int i = p.getInt("players", 0);
String saveName = nameString; String saveName = nameString;