1
0
Fork 0

PlayerEditor: fixed players edition crash

This commit is contained in:
kauron 2015-07-21 00:57:44 +02:00
parent 8c11be5cdd
commit da6de00c5a

View file

@ -60,10 +60,10 @@ public class PlayerEditor extends ActionBarActivity {
if ( position != -1 ) { if ( position != -1 ) {
Player p = new Player(getSharedPreferences("player" + position, MODE_PRIVATE)); Player p = new Player(getSharedPreferences("player" + position, MODE_PRIVATE));
name.setText(p.getName()); name.setText(p.getName());
xp.setText(p.getXp()); xp.setText(String.valueOf(p.getXp()));
int[] attack = p.getAtk(); int[] attack = p.getAtk();
for (int i = Player.STR; i < Player.CHA + 1; i++) for (int i = Player.STR; i < Player.CHA + 1; i++)
atk[i].setText(attack[i]); atk[i].setText(String.valueOf(attack[i]));
classSpinner.setSelection(p.getClassInt()); classSpinner.setSelection(p.getClassInt());
raceSpinner.setSelection(p.getRaceInt()); raceSpinner.setSelection(p.getRaceInt());
} }