summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2005-11-06 13:42:26 +0000
committerpeter1138 <peter1138@openttd.org>2005-11-06 13:42:26 +0000
commitbc25cd89bffd79785957b3f91f78c6646e9a51a6 (patch)
tree84353e1ac91e579a3ea163316e9e1fe281200d11 /vehicle.c
parent220b4c27c1f8f58740ae4195e71f5e582a8474d0 (diff)
downloadopenttd-bc25cd89bffd79785957b3f91f78c6646e9a51a6.tar.xz
(svn r3148) -NewGRF, Feature: Add support for cargo refitting specification by cargo classes.
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/vehicle.c b/vehicle.c
index cec46a357..ff327d25c 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -689,18 +689,7 @@ bool CanFillVehicle(Vehicle *v)
bool CanRefitTo(const Vehicle *v, CargoID cid_to)
{
CargoID cid = _global_cargo_id[_opt_ptr->landscape][cid_to];
-
- if (cid == GC_INVALID) return false;
-
- if (_engine_refit_masks[v->engine_type]) {
- if (!HASBIT(_engine_refit_masks[v->engine_type], cid)) return false;
- } else {
- /* If we are talking about normal vehicles (no newgrf), you can only refit engines */
- if (v->type == VEH_Train && (RailVehInfo(v->engine_type)->flags & RVI_WAGON)) return false;
- if (!HASBIT(_default_refitmasks[v->type - VEH_Train], cid)) return false;
- }
-
- return true;
+ return HASBIT(_engine_info[v->engine_type].refit_mask, cid) != 0;
}
static void DoDrawVehicle(const Vehicle *v)