diff options
author | frosch <frosch@openttd.org> | 2009-03-13 21:28:40 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-03-13 21:28:40 +0000 |
commit | d86e821f539a4838ebe3fb00f8a2bf4dbeb150d6 (patch) | |
tree | 8317c89e21d332e45318d53d44851fe0a13c0a4a /src/train_cmd.cpp | |
parent | 0bbb7dfd38aeebe8c22934e5e904a72362344a99 (diff) | |
download | openttd-d86e821f539a4838ebe3fb00f8a2bf4dbeb150d6.tar.xz |
(svn r15701) -Fix [FS#2595]: Blame NewGRFs returning inconsistent information in purchase-list/after building before users have a chance to blame OpenTTD for incorrectly autorenewing/-replacing.
Diffstat (limited to 'src/train_cmd.cpp')
-rw-r--r-- | src/train_cmd.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 8cccb6763..eede8507d 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -178,23 +178,7 @@ static void RailVehicleLengthChanged(const Vehicle *u) uint32 grfid = engine->grffile->grfid; GRFConfig *grfconfig = GetGRFConfig(grfid); if (GamelogGRFBugReverse(grfid, engine->internal_id) || !HasBit(grfconfig->grf_bugs, GBUG_VEH_LENGTH)) { - SetBit(grfconfig->grf_bugs, GBUG_VEH_LENGTH); - SetDParamStr(0, grfconfig->name); - SetDParam(1, u->engine_type); - ShowErrorMessage(STR_NEWGRF_BROKEN_VEHICLE_LENGTH, STR_NEWGRF_BROKEN, 0, 0); - - /* debug output */ - char buffer[512]; - - SetDParamStr(0, grfconfig->name); - GetString(buffer, STR_NEWGRF_BROKEN, lastof(buffer)); - DEBUG(grf, 0, "%s", buffer + 3); - - SetDParam(1, u->engine_type); - GetString(buffer, STR_NEWGRF_BROKEN_VEHICLE_LENGTH, lastof(buffer)); - DEBUG(grf, 0, "%s", buffer + 3); - - if (!_networking) _pause_game = -1; + ShowNewGrfVehicleError(u->engine_type, STR_NEWGRF_BROKEN, STR_NEWGRF_BROKEN_VEHICLE_LENGTH, GBUG_VEH_LENGTH, true); } } @@ -678,6 +662,8 @@ static CommandCost CmdBuildRailWagon(EngineID engine, TileIndex tile, DoCommandF InvalidateAutoreplaceWindow(v->engine_type, v->group_id); // updates the replace Train window } GetCompany(_current_company)->num_engines[engine]++; + + CheckConsistencyOfArticulatedVehicle(v); } return value; @@ -857,6 +843,8 @@ CommandCost CmdBuildRailVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, } GetCompany(_current_company)->num_engines[p1]++; + + CheckConsistencyOfArticulatedVehicle(v); } return value; |