(svn r23733) -Fix-ish [FS#4939]: cheating to different climates messes things even more up than changing NewGRFs in-game... so guess what happened

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
rubidium 13 years ago
parent aa482051ed
commit abbc0f052b

@ -87,26 +87,6 @@ static int32 ClickSetProdCheat(int32 p1, int32 p2)
return _cheats.setup_prod.value;
}
/**
* Handle changing of climate.
* @param p1 New climate.
* @param p2 Unused.
* @return New climate.
*/
static int32 ClickChangeClimateCheat(int32 p1, int32 p2)
{
if (p1 == -1) p1 = 3;
if (p1 == 4) p1 = 0;
_settings_game.game_creation.landscape = p1;
GamelogStartAction(GLAT_CHEAT);
GamelogTestMode();
ReloadNewGRFData();
GamelogStopAction();
return _settings_game.game_creation.landscape;
}
extern void EnginesMonthlyLoop();
/**
@ -140,7 +120,6 @@ enum CheatNumbers {
CHT_CROSSINGTUNNELS, ///< Allow tunnels to cross each other.
CHT_NO_JETCRASH, ///< Disable jet-airplane crashes.
CHT_SETUP_PROD, ///< Allow manually editing of industry production.
CHT_SWITCH_CLIMATE, ///< Switch climate.
CHT_CHANGE_DATE, ///< Do time traveling.
CHT_NUM_CHEATS, ///< Number of cheats.
@ -173,7 +152,6 @@ static const CheatEntry _cheats_ui[] = {
{SLE_BOOL, STR_CHEAT_CROSSINGTUNNELS, &_cheats.crossing_tunnels.value, &_cheats.crossing_tunnels.been_used, NULL },
{SLE_BOOL, STR_CHEAT_NO_JETCRASH, &_cheats.no_jetcrash.value, &_cheats.no_jetcrash.been_used, NULL },
{SLE_BOOL, STR_CHEAT_SETUP_PROD, &_cheats.setup_prod.value, &_cheats.setup_prod.been_used, &ClickSetProdCheat },
{SLE_UINT8, STR_CHEAT_SWITCH_CLIMATE, &_settings_game.game_creation.landscape, &_cheats.switch_climate.been_used, &ClickChangeClimateCheat },
{SLE_INT32, STR_CHEAT_CHANGE_DATE, &_cur_year, &_cheats.change_date.been_used, &ClickChangeDateCheat },
};
@ -247,10 +225,6 @@ struct CheatWindow : Window {
break;
}
/* Set correct string for switch climate cheat */
case STR_CHEAT_SWITCH_CLIMATE: val += STR_CHEAT_SWITCH_CLIMATE_TEMPERATE_LANDSCAPE;
/* FALL THROUGH */
default: SetDParam(0, val);
}
break;
@ -292,14 +266,6 @@ struct CheatWindow : Window {
width = max(width, GetStringBoundingBox(ce->str).width + 10 + 10);
break;
/* Set correct string for switch climate cheat */
case STR_CHEAT_SWITCH_CLIMATE:
for (StringID i = STR_CHEAT_SWITCH_CLIMATE_TEMPERATE_LANDSCAPE; i <= STR_CHEAT_SWITCH_CLIMATE_TOYLAND_LANDSCAPE; i++) {
SetDParam(0, i);
width = max(width, GetStringBoundingBox(ce->str).width);
}
break;
default:
SetDParam(0, INT64_MAX);
width = max(width, GetStringBoundingBox(ce->str).width);

@ -32,10 +32,10 @@ struct Cheats {
Cheat crossing_tunnels; ///< allow tunnels that cross each other
Cheat dummy1; ///< empty cheat (build while in pause mode)
Cheat no_jetcrash; ///< no jet will crash on small airports anymore
Cheat switch_climate; ///< change the climate of the map
Cheat dummy2; ///< empty cheat (change the climate of the map)
Cheat change_date; ///< changes date ingame
Cheat setup_prod; ///< setup raw-material production in game
Cheat dummy2; ///< empty cheat (enable running el-engines on normal rail)
Cheat dummy3; ///< empty cheat (enable running el-engines on normal rail)
};
extern Cheats _cheats;

@ -1465,7 +1465,6 @@ STR_CHEAT_CHANGE_COMPANY :{LTBLUE}Playing
STR_CHEAT_EXTRA_DYNAMITE :{LTBLUE}Magic bulldozer (remove industries, unmovable objects): {ORANGE}{STRING1}
STR_CHEAT_CROSSINGTUNNELS :{LTBLUE}Tunnels may cross each other: {ORANGE}{STRING1}
STR_CHEAT_NO_JETCRASH :{LTBLUE}Jetplanes will not crash (frequently) on small airports: {ORANGE}{STRING}
STR_CHEAT_SWITCH_CLIMATE :{LTBLUE}Switch climate: {ORANGE}{STRING}
STR_CHEAT_SWITCH_CLIMATE_TEMPERATE_LANDSCAPE :Temperate landscape
STR_CHEAT_SWITCH_CLIMATE_SUB_ARCTIC_LANDSCAPE :Sub-arctic landscape
STR_CHEAT_SWITCH_CLIMATE_SUB_TROPICAL_LANDSCAPE :Sub-tropical landscape

Loading…
Cancel
Save