diff options
author | truebrain <truebrain@openttd.org> | 2011-12-19 21:05:25 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-12-19 21:05:25 +0000 |
commit | cc3f42794d134b9f4b6c7efecb07d4b3366887c1 (patch) | |
tree | 1cd422d47fc44bd59463d0f9e2ef96f2edb09b50 /src/script/api/script_vehicle.cpp | |
parent | 403cd3acdb7b7fedf2b5e823326611bb32113385 (diff) | |
download | openttd-cc3f42794d134b9f4b6c7efecb07d4b3366887c1.tar.xz |
(svn r23632) -Add: GSCompanyMode, to change company in GameScripts
Diffstat (limited to 'src/script/api/script_vehicle.cpp')
-rw-r--r-- | src/script/api/script_vehicle.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/script/api/script_vehicle.cpp b/src/script/api/script_vehicle.cpp index 17fc8679f..d4f3056cc 100644 --- a/src/script/api/script_vehicle.cpp +++ b/src/script/api/script_vehicle.cpp @@ -15,7 +15,6 @@ #include "script_gamesettings.hpp" #include "script_group.hpp" #include "../script_instance.hpp" -#include "../../company_func.h" #include "../../string_func.h" #include "../../strings_func.h" #include "../../command_func.h" @@ -28,7 +27,7 @@ /* static */ bool ScriptVehicle::IsValidVehicle(VehicleID vehicle_id) { const Vehicle *v = ::Vehicle::GetIfValid(vehicle_id); - return v != NULL && (v->owner == _current_company || _current_company == OWNER_DEITY) && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::Train::From(v)->IsFreeWagon())); + return v != NULL && (v->owner == ScriptObject::GetCompany() || ScriptObject::GetCompany() == OWNER_DEITY) && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::Train::From(v)->IsFreeWagon())); } /* static */ ScriptCompany::CompanyID ScriptVehicle::GetOwner(VehicleID vehicle_id) |