Merge branch 'master' into jgrpp
# Conflicts: # src/script/api/script_company.cpp # src/script/api/script_date.cpp # src/script/api/script_date.hpp # src/script/api/script_gamesettings.cpp # src/script/api/script_order.hpp # src/script/api/script_town.cpp # src/script/api/script_window.cpp
This commit is contained in:
@@ -41,10 +41,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ bool ScriptTile::IsBuildableRectangle(TileIndex tile, uint width, uint height)
|
||||
/* static */ bool ScriptTile::IsBuildableRectangle(TileIndex tile, SQInteger width, SQInteger height)
|
||||
{
|
||||
/* Check whether we can extract valid X and Y */
|
||||
if (!::IsValidTile(tile)) return false;
|
||||
if (!::IsValidTile(tile) || width < 0 || height < 0) return false;
|
||||
|
||||
uint tx = ScriptMap::GetTileX(tile);
|
||||
uint ty = ScriptMap::GetTileY(tile);
|
||||
@@ -177,21 +177,21 @@
|
||||
return (Slope)::ComplementSlope((::Slope)slope);
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptTile::GetMinHeight(TileIndex tile)
|
||||
/* static */ SQInteger ScriptTile::GetMinHeight(TileIndex tile)
|
||||
{
|
||||
if (!::IsValidTile(tile)) return -1;
|
||||
|
||||
return ::GetTileZ(tile);
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptTile::GetMaxHeight(TileIndex tile)
|
||||
/* static */ SQInteger ScriptTile::GetMaxHeight(TileIndex tile)
|
||||
{
|
||||
if (!::IsValidTile(tile)) return -1;
|
||||
|
||||
return ::GetTileMaxZ(tile);
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptTile::GetCornerHeight(TileIndex tile, Corner corner)
|
||||
/* static */ SQInteger ScriptTile::GetCornerHeight(TileIndex tile, Corner corner)
|
||||
{
|
||||
if (!::IsValidTile(tile) || !::IsValidCorner((::Corner)corner)) return -1;
|
||||
|
||||
@@ -221,7 +221,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptTile::GetCargoAcceptance(TileIndex tile, CargoID cargo_type, int width, int height, int radius)
|
||||
/* static */ SQInteger ScriptTile::GetCargoAcceptance(TileIndex tile, CargoID cargo_type, SQInteger width, SQInteger height, SQInteger radius)
|
||||
{
|
||||
if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius < 0 || !ScriptCargo::IsValidCargo(cargo_type)) return -1;
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
return acceptance[cargo_type];
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptTile::GetCargoProduction(TileIndex tile, CargoID cargo_type, int width, int height, int radius)
|
||||
/* static */ SQInteger ScriptTile::GetCargoProduction(TileIndex tile, CargoID cargo_type, SQInteger width, SQInteger height, SQInteger radius)
|
||||
{
|
||||
if (!::IsValidTile(tile) || width <= 0 || height <= 0 || radius < 0 || !ScriptCargo::IsValidCargo(cargo_type)) return -1;
|
||||
|
||||
@@ -237,17 +237,17 @@
|
||||
return produced[cargo_type];
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptTile::GetDistanceManhattanToTile(TileIndex tile_from, TileIndex tile_to)
|
||||
/* static */ SQInteger ScriptTile::GetDistanceManhattanToTile(TileIndex tile_from, TileIndex tile_to)
|
||||
{
|
||||
return ScriptMap::DistanceManhattan(tile_from, tile_to);
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptTile::GetDistanceSquareToTile(TileIndex tile_from, TileIndex tile_to)
|
||||
/* static */ SQInteger ScriptTile::GetDistanceSquareToTile(TileIndex tile_from, TileIndex tile_to)
|
||||
{
|
||||
return ScriptMap::DistanceSquare(tile_from, tile_to);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptTile::RaiseTile(TileIndex tile, int32 slope)
|
||||
/* static */ bool ScriptTile::RaiseTile(TileIndex tile, Slope slope)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforcePrecondition(false, tile < ScriptMap::GetMapSize());
|
||||
@@ -255,7 +255,7 @@
|
||||
return ScriptObject::DoCommand(tile, slope, 1, CMD_TERRAFORM_LAND);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptTile::LowerTile(TileIndex tile, int32 slope)
|
||||
/* static */ bool ScriptTile::LowerTile(TileIndex tile, Slope slope)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforcePrecondition(false, tile < ScriptMap::GetMapSize());
|
||||
@@ -287,7 +287,7 @@
|
||||
return ScriptObject::DoCommand(tile, TREE_INVALID, tile, CMD_PLANT_TREE);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptTile::PlantTreeRectangle(TileIndex tile, uint width, uint height)
|
||||
/* static */ bool ScriptTile::PlantTreeRectangle(TileIndex tile, SQInteger width, SQInteger height)
|
||||
{
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforcePrecondition(false, ::IsValidTile(tile));
|
||||
|
Reference in New Issue
Block a user