diff options
author | yexo <yexo@openttd.org> | 2009-04-26 17:01:05 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-04-26 17:01:05 +0000 |
commit | 3578f4408c9f57bcec206ff51dc946469fd3b546 (patch) | |
tree | ec6b0b1dced8b56ede6d7d77fb31b47f785e2234 /src/ai/api | |
parent | 5b5cee940516636f50f4ddbd2cf4de7e7ee1d97c (diff) | |
download | openttd-3578f4408c9f57bcec206ff51dc946469fd3b546.tar.xz |
(svn r16171) -Add [NoAI]: two new error codes to AITile: ERR_AREA_ALREADY_FLAT and ERR_ESCAVATION_WOULD_DAMAGE.
Diffstat (limited to 'src/ai/api')
-rw-r--r-- | src/ai/api/ai_tile.hpp | 6 | ||||
-rw-r--r-- | src/ai/api/ai_tile.hpp.sq | 84 |
2 files changed, 51 insertions, 39 deletions
diff --git a/src/ai/api/ai_tile.hpp b/src/ai/api/ai_tile.hpp index 808bbcf52..0c12656e2 100644 --- a/src/ai/api/ai_tile.hpp +++ b/src/ai/api/ai_tile.hpp @@ -29,6 +29,12 @@ public: /** Tile can't be lowered any lower */ ERR_TILE_TOO_LOW, // [STR_ERROR_ALREADY_AT_SEA_LEVEL] + + /** The area was already flat */ + ERR_AREA_ALREADY_FLAT, // [STR_ALREADY_LEVELLED] + + /** There is a tunnel underneed */ + ERR_ESCAVATION_WOULD_DAMAGE, // [STR_ERROR_EXCAVATION_WOULD_DAMAGE] }; /** diff --git a/src/ai/api/ai_tile.hpp.sq b/src/ai/api/ai_tile.hpp.sq index 481cb68f9..9549218b4 100644 --- a/src/ai/api/ai_tile.hpp.sq +++ b/src/ai/api/ai_tile.hpp.sq @@ -27,47 +27,53 @@ void SQAITile_Register(Squirrel *engine) { SQAITile.PreRegister(engine); SQAITile.AddConstructor<void (AITile::*)(), 1>(engine, "x"); - SQAITile.DefSQConst(engine, AITile::ERR_TILE_BASE, "ERR_TILE_BASE"); - SQAITile.DefSQConst(engine, AITile::ERR_TILE_TOO_HIGH, "ERR_TILE_TOO_HIGH"); - SQAITile.DefSQConst(engine, AITile::ERR_TILE_TOO_LOW, "ERR_TILE_TOO_LOW"); - SQAITile.DefSQConst(engine, AITile::CORNER_W, "CORNER_W"); - SQAITile.DefSQConst(engine, AITile::CORNER_S, "CORNER_S"); - SQAITile.DefSQConst(engine, AITile::CORNER_E, "CORNER_E"); - SQAITile.DefSQConst(engine, AITile::CORNER_N, "CORNER_N"); - SQAITile.DefSQConst(engine, AITile::CORNER_INVALID, "CORNER_INVALID"); - SQAITile.DefSQConst(engine, AITile::SLOPE_FLAT, "SLOPE_FLAT"); - SQAITile.DefSQConst(engine, AITile::SLOPE_W, "SLOPE_W"); - SQAITile.DefSQConst(engine, AITile::SLOPE_S, "SLOPE_S"); - SQAITile.DefSQConst(engine, AITile::SLOPE_E, "SLOPE_E"); - SQAITile.DefSQConst(engine, AITile::SLOPE_N, "SLOPE_N"); - SQAITile.DefSQConst(engine, AITile::SLOPE_STEEP, "SLOPE_STEEP"); - SQAITile.DefSQConst(engine, AITile::SLOPE_NW, "SLOPE_NW"); - SQAITile.DefSQConst(engine, AITile::SLOPE_SW, "SLOPE_SW"); - SQAITile.DefSQConst(engine, AITile::SLOPE_SE, "SLOPE_SE"); - SQAITile.DefSQConst(engine, AITile::SLOPE_NE, "SLOPE_NE"); - SQAITile.DefSQConst(engine, AITile::SLOPE_EW, "SLOPE_EW"); - SQAITile.DefSQConst(engine, AITile::SLOPE_NS, "SLOPE_NS"); - SQAITile.DefSQConst(engine, AITile::SLOPE_ELEVATED, "SLOPE_ELEVATED"); - SQAITile.DefSQConst(engine, AITile::SLOPE_NWS, "SLOPE_NWS"); - SQAITile.DefSQConst(engine, AITile::SLOPE_WSE, "SLOPE_WSE"); - SQAITile.DefSQConst(engine, AITile::SLOPE_SEN, "SLOPE_SEN"); - SQAITile.DefSQConst(engine, AITile::SLOPE_ENW, "SLOPE_ENW"); - SQAITile.DefSQConst(engine, AITile::SLOPE_STEEP_W, "SLOPE_STEEP_W"); - SQAITile.DefSQConst(engine, AITile::SLOPE_STEEP_S, "SLOPE_STEEP_S"); - SQAITile.DefSQConst(engine, AITile::SLOPE_STEEP_E, "SLOPE_STEEP_E"); - SQAITile.DefSQConst(engine, AITile::SLOPE_STEEP_N, "SLOPE_STEEP_N"); - SQAITile.DefSQConst(engine, AITile::SLOPE_INVALID, "SLOPE_INVALID"); - SQAITile.DefSQConst(engine, AITile::TRANSPORT_RAIL, "TRANSPORT_RAIL"); - SQAITile.DefSQConst(engine, AITile::TRANSPORT_ROAD, "TRANSPORT_ROAD"); - SQAITile.DefSQConst(engine, AITile::TRANSPORT_WATER, "TRANSPORT_WATER"); - SQAITile.DefSQConst(engine, AITile::TRANSPORT_AIR, "TRANSPORT_AIR"); - SQAITile.DefSQConst(engine, AITile::TRANSPORT_INVALID, "TRANSPORT_INVALID"); + SQAITile.DefSQConst(engine, AITile::ERR_TILE_BASE, "ERR_TILE_BASE"); + SQAITile.DefSQConst(engine, AITile::ERR_TILE_TOO_HIGH, "ERR_TILE_TOO_HIGH"); + SQAITile.DefSQConst(engine, AITile::ERR_TILE_TOO_LOW, "ERR_TILE_TOO_LOW"); + SQAITile.DefSQConst(engine, AITile::ERR_AREA_ALREADY_FLAT, "ERR_AREA_ALREADY_FLAT"); + SQAITile.DefSQConst(engine, AITile::ERR_ESCAVATION_WOULD_DAMAGE, "ERR_ESCAVATION_WOULD_DAMAGE"); + SQAITile.DefSQConst(engine, AITile::CORNER_W, "CORNER_W"); + SQAITile.DefSQConst(engine, AITile::CORNER_S, "CORNER_S"); + SQAITile.DefSQConst(engine, AITile::CORNER_E, "CORNER_E"); + SQAITile.DefSQConst(engine, AITile::CORNER_N, "CORNER_N"); + SQAITile.DefSQConst(engine, AITile::CORNER_INVALID, "CORNER_INVALID"); + SQAITile.DefSQConst(engine, AITile::SLOPE_FLAT, "SLOPE_FLAT"); + SQAITile.DefSQConst(engine, AITile::SLOPE_W, "SLOPE_W"); + SQAITile.DefSQConst(engine, AITile::SLOPE_S, "SLOPE_S"); + SQAITile.DefSQConst(engine, AITile::SLOPE_E, "SLOPE_E"); + SQAITile.DefSQConst(engine, AITile::SLOPE_N, "SLOPE_N"); + SQAITile.DefSQConst(engine, AITile::SLOPE_STEEP, "SLOPE_STEEP"); + SQAITile.DefSQConst(engine, AITile::SLOPE_NW, "SLOPE_NW"); + SQAITile.DefSQConst(engine, AITile::SLOPE_SW, "SLOPE_SW"); + SQAITile.DefSQConst(engine, AITile::SLOPE_SE, "SLOPE_SE"); + SQAITile.DefSQConst(engine, AITile::SLOPE_NE, "SLOPE_NE"); + SQAITile.DefSQConst(engine, AITile::SLOPE_EW, "SLOPE_EW"); + SQAITile.DefSQConst(engine, AITile::SLOPE_NS, "SLOPE_NS"); + SQAITile.DefSQConst(engine, AITile::SLOPE_ELEVATED, "SLOPE_ELEVATED"); + SQAITile.DefSQConst(engine, AITile::SLOPE_NWS, "SLOPE_NWS"); + SQAITile.DefSQConst(engine, AITile::SLOPE_WSE, "SLOPE_WSE"); + SQAITile.DefSQConst(engine, AITile::SLOPE_SEN, "SLOPE_SEN"); + SQAITile.DefSQConst(engine, AITile::SLOPE_ENW, "SLOPE_ENW"); + SQAITile.DefSQConst(engine, AITile::SLOPE_STEEP_W, "SLOPE_STEEP_W"); + SQAITile.DefSQConst(engine, AITile::SLOPE_STEEP_S, "SLOPE_STEEP_S"); + SQAITile.DefSQConst(engine, AITile::SLOPE_STEEP_E, "SLOPE_STEEP_E"); + SQAITile.DefSQConst(engine, AITile::SLOPE_STEEP_N, "SLOPE_STEEP_N"); + SQAITile.DefSQConst(engine, AITile::SLOPE_INVALID, "SLOPE_INVALID"); + SQAITile.DefSQConst(engine, AITile::TRANSPORT_RAIL, "TRANSPORT_RAIL"); + SQAITile.DefSQConst(engine, AITile::TRANSPORT_ROAD, "TRANSPORT_ROAD"); + SQAITile.DefSQConst(engine, AITile::TRANSPORT_WATER, "TRANSPORT_WATER"); + SQAITile.DefSQConst(engine, AITile::TRANSPORT_AIR, "TRANSPORT_AIR"); + SQAITile.DefSQConst(engine, AITile::TRANSPORT_INVALID, "TRANSPORT_INVALID"); - AIError::RegisterErrorMap(STR_ERROR_ALREADY_AT_SEA_LEVEL, AITile::ERR_TILE_TOO_HIGH); - AIError::RegisterErrorMap(STR_ERROR_ALREADY_AT_SEA_LEVEL, AITile::ERR_TILE_TOO_LOW); + AIError::RegisterErrorMap(STR_ERROR_ALREADY_AT_SEA_LEVEL, AITile::ERR_TILE_TOO_HIGH); + AIError::RegisterErrorMap(STR_ERROR_ALREADY_AT_SEA_LEVEL, AITile::ERR_TILE_TOO_LOW); + AIError::RegisterErrorMap(STR_ALREADY_LEVELLED, AITile::ERR_AREA_ALREADY_FLAT); + AIError::RegisterErrorMap(STR_ERROR_EXCAVATION_WOULD_DAMAGE, AITile::ERR_ESCAVATION_WOULD_DAMAGE); - AIError::RegisterErrorMapString(AITile::ERR_TILE_TOO_HIGH, "ERR_TILE_TOO_HIGH"); - AIError::RegisterErrorMapString(AITile::ERR_TILE_TOO_LOW, "ERR_TILE_TOO_LOW"); + AIError::RegisterErrorMapString(AITile::ERR_TILE_TOO_HIGH, "ERR_TILE_TOO_HIGH"); + AIError::RegisterErrorMapString(AITile::ERR_TILE_TOO_LOW, "ERR_TILE_TOO_LOW"); + AIError::RegisterErrorMapString(AITile::ERR_AREA_ALREADY_FLAT, "ERR_AREA_ALREADY_FLAT"); + AIError::RegisterErrorMapString(AITile::ERR_ESCAVATION_WOULD_DAMAGE, "ERR_ESCAVATION_WOULD_DAMAGE"); SQAITile.DefSQStaticMethod(engine, &AITile::IsBuildable, "IsBuildable", 2, ".i"); SQAITile.DefSQStaticMethod(engine, &AITile::IsBuildableRectangle, "IsBuildableRectangle", 4, ".iii"); |