mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Use SQInteger for generic numbers in script_companymode
parent
89c0841d0a
commit
424ae74504
|
@ -13,13 +13,13 @@
|
||||||
|
|
||||||
#include "../../safeguards.h"
|
#include "../../safeguards.h"
|
||||||
|
|
||||||
ScriptCompanyMode::ScriptCompanyMode(int company)
|
ScriptCompanyMode::ScriptCompanyMode(SQInteger company)
|
||||||
{
|
{
|
||||||
if (company < OWNER_BEGIN || company >= MAX_COMPANIES) company = INVALID_COMPANY;
|
if (company < OWNER_BEGIN || company >= MAX_COMPANIES) company = INVALID_COMPANY;
|
||||||
if (!::Company::IsValidID(company)) company = INVALID_COMPANY;
|
if (!::Company::IsValidID(company)) company = INVALID_COMPANY;
|
||||||
|
|
||||||
this->last_company = ScriptObject::GetCompany();
|
this->last_company = ScriptObject::GetCompany();
|
||||||
ScriptObject::SetCompany((CompanyID)company);
|
ScriptObject::SetCompany((::CompanyID)company);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptCompanyMode::~ScriptCompanyMode()
|
ScriptCompanyMode::~ScriptCompanyMode()
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
* @note When the instance is destroyed, it restores the company that was
|
* @note When the instance is destroyed, it restores the company that was
|
||||||
* current when the instance was created!
|
* current when the instance was created!
|
||||||
*/
|
*/
|
||||||
ScriptCompanyMode(int company);
|
ScriptCompanyMode(SQInteger company);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroying this instance reset the company to that what it was
|
* Destroying this instance reset the company to that what it was
|
||||||
|
|
Loading…
Reference in New Issue