summaryrefslogtreecommitdiff
path: root/src/script/api/script_group.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 21:05:25 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 21:05:25 +0000
commitcc3f42794d134b9f4b6c7efecb07d4b3366887c1 (patch)
tree1cd422d47fc44bd59463d0f9e2ef96f2edb09b50 /src/script/api/script_group.cpp
parent403cd3acdb7b7fedf2b5e823326611bb32113385 (diff)
downloadopenttd-cc3f42794d134b9f4b6c7efecb07d4b3366887c1.tar.xz
(svn r23632) -Add: GSCompanyMode, to change company in GameScripts
Diffstat (limited to 'src/script/api/script_group.cpp')
-rw-r--r--src/script/api/script_group.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/api/script_group.cpp b/src/script/api/script_group.cpp
index 050cc63a9..4f9ce8a2a 100644
--- a/src/script/api/script_group.cpp
+++ b/src/script/api/script_group.cpp
@@ -24,7 +24,7 @@
/* static */ bool ScriptGroup::IsValidGroup(GroupID group_id)
{
const Group *g = ::Group::GetIfValid(group_id);
- return g != NULL && g->owner == _current_company;
+ return g != NULL && g->owner == ScriptObject::GetCompany();
}
/* static */ ScriptGroup::GroupID ScriptGroup::CreateGroup(ScriptVehicle::VehicleType vehicle_type)
@@ -88,7 +88,7 @@
{
if (!IsValidGroup(group_id) && group_id != GROUP_DEFAULT && group_id != GROUP_ALL) return -1;
- return GetGroupNumEngines(_current_company, group_id, engine_id);
+ return GetGroupNumEngines(ScriptObject::GetCompany(), group_id, engine_id);
}
/* static */ bool ScriptGroup::MoveVehicle(GroupID group_id, VehicleID vehicle_id)
@@ -108,7 +108,7 @@
/* static */ bool ScriptGroup::HasWagonRemoval()
{
- return ::Company::Get(_current_company)->settings.renew_keep_length;
+ return ::Company::Get(ScriptObject::GetCompany())->settings.renew_keep_length;
}
/* static */ bool ScriptGroup::SetAutoReplace(GroupID group_id, EngineID engine_id_old, EngineID engine_id_new)
@@ -123,7 +123,7 @@
{
if (!IsValidGroup(group_id) && group_id != GROUP_DEFAULT && group_id != GROUP_ALL) return ::INVALID_ENGINE;
- return ::EngineReplacementForCompany(Company::Get(_current_company), engine_id, group_id);
+ return ::EngineReplacementForCompany(Company::Get(ScriptObject::GetCompany()), engine_id, group_id);
}
/* static */ bool ScriptGroup::StopAutoReplace(GroupID group_id, EngineID engine_id)