fix robot having human name in config dialog

This commit is contained in:
Eric House 2022-12-13 06:13:03 -08:00
parent 988cf7f175
commit e051fa04f9
2 changed files with 5 additions and 7 deletions

View file

@ -306,6 +306,7 @@ public class CurGameInfo implements Serializable {
players[1] = new LocalPlayer( context, 1 );
if ( standalone ) {
players[1].setIsRobot( true );
players[1].name = CommonPrefs.getDefaultRobotName( context );
} else {
players[1].isLocal = false;
}

View file

@ -103,13 +103,10 @@ public class LocalPlayer implements Serializable {
@Override
public String toString()
{
String result;
if ( BuildConfig.DEBUG ) {
result = String.format( "{name: %s, isLocal: %b, robotIQ: %d}",
name, isLocal, robotIQ );
} else {
result = super.toString();
}
String result = BuildConfig.DEBUG
? String.format( "{name: %s, isLocal: %b, robotIQ: %d}",
name, isLocal, robotIQ )
: super.toString();
return result;
}
}