Cleaned up ugly Android-specifc hack

This commit is contained in:
Sergii Pylypenko
2019-08-31 19:31:38 +03:00
parent 08f144fabe
commit dd2c249473

View File

@@ -502,24 +502,6 @@ struct AfterNewGRFScan : NewGRFScanCallback {
}
#endif /* ENABLE_NETWORK */
// TODO: remove this hack in one year
// Check if OpenTTD config is broken by blitter changing code
static bool checked = false;
DEBUG(misc, 0, "========= Limits for vehicles: %d %d %d %d", _settings_newgame.vehicle.max_trains, _settings_newgame.vehicle.max_roadveh, _settings_newgame.vehicle.max_aircraft, _settings_newgame.vehicle.max_ships);
if (!checked &&
_settings_newgame.vehicle.max_trains == 0 && _settings_newgame.vehicle.max_roadveh == 0 &&
_settings_newgame.vehicle.max_aircraft == 0 && _settings_newgame.vehicle.max_ships == 0) {
if (access(".openttd/openttd-backup.cfg", F_OK) == 0) {
system("mv -f .openttd/openttd-backup.cfg .openttd/openttd.cfg");
} else {
unlink("libsdl-DownloadFinished-1.flag");
}
//_exit_game = true;
//_restart_game = true;
_exit(0); // kill(getpid(), SIG_KILL); //abort(); // Kill myself with contempt, user will restart the app, because otherwise we enter infinite restart loop
}
checked = true;
/* After the scan we're not used anymore. */
delete this;
}