diff options
author | tron <tron@openttd.org> | 2005-10-18 07:01:00 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-10-18 07:01:00 +0000 |
commit | d4752ba0da4c6387020167b3acee938ed14d9a66 (patch) | |
tree | a9e1c8d1f0c24a73580b5124a2e50ab1823ab161 /train_cmd.c | |
parent | d4463b4b950163ebe6cb8db989967ce65ad75da5 (diff) | |
download | openttd-d4752ba0da4c6387020167b3acee938ed14d9a66.tar.xz |
(svn r3058) The default AI may not build dual headed trains under certain circumstances.
Simplify this check by testing the rail vehicle info flags instead of passing a global variable around.
Note: This is not exactly the original behaviour, because the Lev4 was always allowed to be built, but i guess that was a glitch.
Diffstat (limited to 'train_cmd.c')
-rw-r--r-- | train_cmd.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/train_cmd.c b/train_cmd.c index b643505c5..1e9603f95 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -498,24 +498,6 @@ static void NormalizeTrainVehInDepot(Vehicle *u) } } -static const byte _railveh_unk1[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 1, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, - 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -}; - static const byte _railveh_score[] = { 1, 4, 7, 19, 20, 30, 31, 19, 20, 21, 22, 10, 11, 30, 31, 32, @@ -590,8 +572,6 @@ int32 CmdBuildRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2) if (!IsTileOwner(tile, _current_player)) return CMD_ERROR; } - _cmd_build_rail_veh_var1 = 0; - SET_EXPENSES_TYPE(EXPENSES_NEW_VEHICLES); rvi = RailVehInfo(p1); @@ -676,7 +656,6 @@ int32 CmdBuildRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2) InvalidateWindow(WC_COMPANY, v->owner); } } - _cmd_build_rail_veh_var1 = _railveh_unk1[p1]; _cmd_build_rail_veh_score = _railveh_score[p1]; InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train); // updates the replace Train window |