(svn r23632) -Add: GSCompanyMode, to change company in GameScripts

This commit is contained in:
truebrain
2011-12-19 21:05:25 +00:00
parent 403cd3acdb
commit cc3f42794d
46 changed files with 273 additions and 59 deletions

View File

@@ -17,13 +17,12 @@
#include "../../debug.h"
#include "../../station_base.h"
#include "../../roadstop_base.h"
#include "../../company_func.h"
#include "../../town.h"
/* static */ bool ScriptStation::IsValidStation(StationID station_id)
{
const Station *st = ::Station::GetIfValid(station_id);
return st != NULL && (st->owner == _current_company || _current_company == OWNER_DEITY || st->owner == OWNER_NONE);
return st != NULL && (st->owner == ScriptObject::GetCompany() || ScriptObject::GetCompany() == OWNER_DEITY || st->owner == OWNER_NONE);
}
/* static */ ScriptCompany::CompanyID ScriptStation::GetOwner(StationID station_id)