diff options
author | rubidium <rubidium@openttd.org> | 2008-04-21 13:45:03 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-04-21 13:45:03 +0000 |
commit | 22140d82c6efb1a6a03e1e4db0eca48766dce8ba (patch) | |
tree | c45ca2198e745f3be4cfbe13a2949d2699a4b1f3 /src/ship_cmd.cpp | |
parent | a40bba8bace426b961d31f5b0362629044c0766e (diff) | |
download | openttd-22140d82c6efb1a6a03e1e4db0eca48766dce8ba.tar.xz |
(svn r12818) -Codechange: make callbacks 31 and 37 behave like they do in TTDP according to frosch's survey.
Diffstat (limited to 'src/ship_cmd.cpp')
-rw-r--r-- | src/ship_cmd.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 1207d2a68..2a0e7222b 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -882,19 +882,16 @@ CommandCost CmdSellShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) */ CommandCost CmdStartStopShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { - Vehicle *v; - uint16 callback; - if (!IsValidVehicleID(p1)) return CMD_ERROR; - v = GetVehicle(p1); + Vehicle *v = GetVehicle(p1); if (v->type != VEH_SHIP || !CheckOwnership(v->owner)) return CMD_ERROR; /* Check if this ship can be started/stopped. The callback will fail or * return 0xFF if it can. */ - callback = GetVehicleCallback(CBID_VEHICLE_START_STOP_CHECK, 0, 0, v->engine_type, v); - if (callback != CALLBACK_FAILED && callback != 0xFF) { + uint16 callback = GetVehicleCallback(CBID_VEHICLE_START_STOP_CHECK, 0, 0, v->engine_type, v); + if (callback != CALLBACK_FAILED && GB(callback, 0, 8) != 0xFF) { StringID error = GetGRFStringID(GetEngineGRFID(v->engine_type), 0xD000 + callback); return_cmd_error(error); } |