1
0
Fork 0

Change: Allow GS access to more ScriptCompany functions

pull/10669/head
SamuXarick 2023-01-23 20:13:28 +00:00 committed by rubidium42
parent 8b1960a41c
commit fd26a44c9e
3 changed files with 7 additions and 5 deletions

View File

@ -39,6 +39,11 @@
* \li GSOrder::CopyOrders
* \li GSOrder::ShareOrders
* \li GSOrder::UnshareOrders
* \li GSCompany::IsMine
* \li GSCompany::SetPresidentGender
* \li GSCompany::SetAutoRenewStatus
* \li GSCompany::SetAutoRenewMonths
* \li GSCompany::SetAutoRenewMoney
*
* API removals:
* \li GSError::ERR_PRECONDITION_TOO_MANY_PARAMETERS, that error is never returned anymore.

View File

@ -40,6 +40,7 @@
/* static */ bool ScriptCompany::IsMine(ScriptCompany::CompanyID company)
{
EnforceCompanyModeValid(false);
return ResolveCompanyID(company) == ResolveCompanyID(COMPANY_SELF);
}

View File

@ -129,8 +129,8 @@ public:
/**
* Check if a CompanyID is your CompanyID, to ease up checks.
* @param company The company index to check.
* @game @pre ScriptCompanyMode::IsValid().
* @return True if and only if this company is your CompanyID.
* @api -game
*/
static bool IsMine(CompanyID company);
@ -177,7 +177,6 @@ public:
* @game @pre ScriptCompanyMode::IsValid().
* @return True if the gender was changed.
* @note When successful a random face will be created.
* @api -game
*/
static bool SetPresidentGender(Gender gender);
@ -338,7 +337,6 @@ public:
* @param autorenew The new autorenew status.
* @game @pre ScriptCompanyMode::IsValid().
* @return True if autorenew status has been modified.
* @api -game
*/
static bool SetAutoRenewStatus(bool autorenew);
@ -356,7 +354,6 @@ public:
* The value will be clamped to MIN(int16) .. MAX(int16).
* @game @pre ScriptCompanyMode::IsValid().
* @return True if autorenew months has been modified.
* @api -game
*/
static bool SetAutoRenewMonths(SQInteger months);
@ -375,7 +372,6 @@ public:
* @return True if autorenew money has been modified.
* @pre money >= 0
* @pre money < 2**32
* @api -game
*/
static bool SetAutoRenewMoney(Money money);