Add: company 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:
@@ -287,6 +287,7 @@ public:
|
||||
/**
|
||||
* Toggle the open/closed state of an airport.
|
||||
* @param station_id The airport to modify.
|
||||
* @game @pre ScriptCompanyMode::IsValid().
|
||||
* @pre IsValidStation(station_id).
|
||||
* @pre HasStationType(station_id, STATION_AIRPORT).
|
||||
* @return True if the state was toggled successfully.
|
||||
|
Reference in New Issue
Block a user