Codechange: use GSCompanyMode::IsValid, IsDeity, and the precondition helpers
Direct 1:1 replacements in the code, and comments now refer to either GSCompanyMode::IsValid or GSCompanyMode::IsDeity instead of several variations on "company mode active" or "no company mode active".
This commit is contained in:
@@ -252,7 +252,7 @@
|
||||
|
||||
/* static */ bool ScriptTile::RaiseTile(TileIndex tile, Slope slope)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforceCompanyModeValid(false);
|
||||
EnforcePrecondition(false, tile < ScriptMap::GetMapSize());
|
||||
|
||||
return ScriptObject::Command<CMD_TERRAFORM_LAND>::Do(tile, (::Slope)slope, true);
|
||||
@@ -260,7 +260,7 @@
|
||||
|
||||
/* static */ bool ScriptTile::LowerTile(TileIndex tile, Slope slope)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforceCompanyModeValid(false);
|
||||
EnforcePrecondition(false, tile < ScriptMap::GetMapSize());
|
||||
|
||||
return ScriptObject::Command<CMD_TERRAFORM_LAND>::Do(tile, (::Slope)slope, false);
|
||||
@@ -268,7 +268,7 @@
|
||||
|
||||
/* static */ bool ScriptTile::LevelTiles(TileIndex start_tile, TileIndex end_tile)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforceCompanyModeValid(false);
|
||||
EnforcePrecondition(false, start_tile < ScriptMap::GetMapSize());
|
||||
EnforcePrecondition(false, end_tile < ScriptMap::GetMapSize());
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
|
||||
/* static */ bool ScriptTile::PlantTree(TileIndex tile)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforceCompanyModeValid(false);
|
||||
EnforcePrecondition(false, ::IsValidTile(tile));
|
||||
|
||||
return ScriptObject::Command<CMD_PLANT_TREE>::Do(tile, tile, TREE_INVALID, false);
|
||||
@@ -292,7 +292,7 @@
|
||||
|
||||
/* static */ bool ScriptTile::PlantTreeRectangle(TileIndex tile, SQInteger width, SQInteger height)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforceCompanyModeValid(false);
|
||||
EnforcePrecondition(false, ::IsValidTile(tile));
|
||||
EnforcePrecondition(false, width >= 1 && width <= 20);
|
||||
EnforcePrecondition(false, height >= 1 && height <= 20);
|
||||
|
Reference in New Issue
Block a user