summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-11-29 22:29:59 +0000
committerpeter1138 <peter1138@openttd.org>2005-11-29 22:29:59 +0000
commitfde99748c0972e137952b118f8b651d725ad37dc (patch)
tree0f74bc18a32d47dcd8443ec9fb7a992a9e350615 /vehicle.c
parent4191adb92cbd9a1cb02b7a913fa90d62ee32ec31 (diff)
downloadopenttd-fde99748c0972e137952b118f8b651d725ad37dc.tar.xz
(svn r3248) - Codechange: Change interface of CanRefitTo() to supply the engine type directly instead of getting it from a vehicle. This allows the function to be used before vehicles are involved.
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vehicle.c b/vehicle.c
index 3c7f3156d..dbf65f494 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -680,15 +680,15 @@ bool CanFillVehicle(Vehicle *v)
return false;
}
-/** Check if a given vehicle (type) can be refitted to a given cargo
- * @param *v vehicle to check
+/** Check if a given engine type can be refitted to a given cargo
+ * @param engine_type Engine type to check
* @param cid_to check refit to this cargo-type
* @return true if it is possible, false otherwise
*/
-bool CanRefitTo(const Vehicle *v, CargoID cid_to)
+bool CanRefitTo(EngineID engine_type, CargoID cid_to)
{
CargoID cid = _global_cargo_id[_opt_ptr->landscape][cid_to];
- return HASBIT(_engine_info[v->engine_type].refit_mask, cid) != 0;
+ return HASBIT(_engine_info[engine_type].refit_mask, cid) != 0;
}
static void DoDrawVehicle(const Vehicle *v)