Add: deity mode enforcement checks to functions with command or company access
Command functions are those that call ScriptObject::Command, and functions with company access are any that call ScriptObject::GetCompany. This is a bit over-protective, but having the check everywhere makes it easier to validate that no check is missing automatically instead of by review.
This commit is contained in:
@@ -55,6 +55,7 @@ public:
|
||||
* @param to_type The type of the subsidy on the 'to' side.
|
||||
* @param to_id The ID of the 'to' side.
|
||||
* @return True if the action succeeded.
|
||||
* @pre ScriptCompanyMode::IsDeity().
|
||||
* @pre ScriptCargo::IsValidCargo(cargo_type)
|
||||
* @pre from_type == SPT_INDUSTRY || from_type == SPT_TOWN.
|
||||
* @pre to_type == SPT_INDUSTRY || to_type == SPT_TOWN.
|
||||
|
Reference in New Issue
Block a user