summaryrefslogtreecommitdiff
path: root/src/openttd.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-30 17:17:04 +0000
committerrubidium <rubidium@openttd.org>2007-08-30 17:17:04 +0000
commitf4482907dabf064299c7ef50a3ff47589ccb54ff (patch)
tree8562d4448fae5c239425c0e3a045ac05afd33329 /src/openttd.h
parentf8306999712ddfd98ee342962ff446ccadcd8d1a (diff)
downloadopenttd-f4482907dabf064299c7ef50a3ff47589ccb54ff.tar.xz
(svn r11005) -Codechange: move the tiletype specific terraforming checks to the functions for those tile types.
-Codechange: barren the rail grounds on terraforming.
Diffstat (limited to 'src/openttd.h')
-rw-r--r--src/openttd.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/openttd.h b/src/openttd.h
index 9fa72e915..2084f3219 100644
--- a/src/openttd.h
+++ b/src/openttd.h
@@ -473,6 +473,20 @@ typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID n
/** @see VehicleEnterTileStatus to see what the return values mean */
typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y);
typedef Foundation GetFoundationProc(TileIndex tile, Slope tileh);
+/**
+ * Called when a tile is affected by a terraforming operation.
+ * The function has to check if terraforming of the tile is allowed and return extra terraform-cost that depend on the tiletype.
+ * With DC_EXEC in flags it has to perform tiletype-specific actions (like clearing land etc., but not the terraforming itself).
+ *
+ * @note The terraforming has not yet taken place. So GetTileZ() and GetTileSlope() refer to the landscape before the terraforming operation.
+ *
+ * @param tile The involved tile.
+ * @param flags Command flags passed to the terraform command (DC_EXEC, DC_QUERY_COST, etc.).
+ * @param z_new TileZ after terraforming.
+ * @param tileh_new Slope after terraforming.
+ * @return Error code or extra cost for terraforming (like clearing land, building foundations, etc., but not the terraforming itself.)
+ */
+typedef CommandCost TerraformTileProc(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new);
struct TileTypeProcs {
DrawTileProc *draw_tile_proc;
@@ -488,6 +502,7 @@ struct TileTypeProcs {
GetProducedCargoProc *get_produced_cargo_proc;
VehicleEnterTileProc *vehicle_enter_tile_proc;
GetFoundationProc *get_foundation_proc;
+ TerraformTileProc *terraform_tile_proc;
};