summaryrefslogtreecommitdiff
path: root/src/script/api/script_vehicle.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:57:23 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:57:23 +0000
commit436cf09923d881f3c11c8a4b6262c0a89ad1ee73 (patch)
tree8c96fbae532958e5cecfd0370387f26fcb837037 /src/script/api/script_vehicle.cpp
parent1616961ea2c1fa84c41d7df9af535fbb190d2c41 (diff)
downloadopenttd-436cf09923d881f3c11c8a4b6262c0a89ad1ee73.tar.xz
(svn r23614) -Add: more API functions exposed to NoGo (part 1)
Diffstat (limited to 'src/script/api/script_vehicle.cpp')
-rw-r--r--src/script/api/script_vehicle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp
index 956c22225..2913d7612 100644
--- a/src/script/api/script_vehicle.cpp
+++ b/src/script/api/script_vehicle.cpp
@@ -28,7 +28,7 @@
/* static */ bool ScriptVehicle::IsValidVehicle(VehicleID vehicle_id)
{
const Vehicle *v = ::Vehicle::GetIfValid(vehicle_id);
- return v != NULL && v->owner == _current_company && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::Train::From(v)->IsFreeWagon()));
+ return v != NULL && (v->owner == _current_company || _current_company == OWNER_DEITY) && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::Train::From(v)->IsFreeWagon()));
}
/* static */ int32 ScriptVehicle::GetNumWagons(VehicleID vehicle_id)