mirror of https://github.com/OpenTTD/OpenTTD
(svn r16992) -Add [NoAI]: function to clear waypoint(s) in a certain rectangle on the map
parent
de99f212dc
commit
4a1f6547c6
|
@ -188,6 +188,14 @@
|
|||
return AIObject::DoCommand(tile, 0, 0, CMD_REMOVE_FROM_RAIL_WAYPOINT);
|
||||
}
|
||||
|
||||
/* static */ bool AIRail::RemoveRailWaypointTileRect(TileIndex tile, TileIndex tile2)
|
||||
{
|
||||
EnforcePrecondition(false, ::IsValidTile(tile));
|
||||
EnforcePrecondition(false, ::IsValidTile(tile2));
|
||||
|
||||
return AIObject::DoCommand(tile, tile2, 0, CMD_REMOVE_FROM_RAIL_WAYPOINT);
|
||||
}
|
||||
|
||||
/* static */ bool AIRail::RemoveRailStationTileRect(TileIndex tile, TileIndex tile2)
|
||||
{
|
||||
EnforcePrecondition(false, ::IsValidTile(tile));
|
||||
|
|
|
@ -282,7 +282,17 @@ public:
|
|||
static bool RemoveRailWaypoint(TileIndex tile);
|
||||
|
||||
/**
|
||||
* Remove a rectangle of platform pieces from a rail station.
|
||||
* Remove all rail waypoint pieces within a rectangle on the map.
|
||||
* @param tile One corner of the rectangle to clear.
|
||||
* @param tile2 The oppposite corner.
|
||||
* @pre IsValidTile(tile).
|
||||
* @pre IsValidTile(tile2).
|
||||
* @return Whether at least one tile has been/can be cleared or not.
|
||||
*/
|
||||
static bool RemoveRailWaypointTileRect(TileIndex tile, TileIndex tile2);
|
||||
|
||||
/**
|
||||
* Remove all rail station platform pieces within a rectangle on the map.
|
||||
* @param tile One corner of the rectangle to clear.
|
||||
* @param tile2 The oppposite corner.
|
||||
* @pre IsValidTile(tile).
|
||||
|
|
|
@ -79,6 +79,7 @@ void SQAIRail_Register(Squirrel *engine) {
|
|||
SQAIRail.DefSQStaticMethod(engine, &AIRail::BuildNewGRFRailStation, "BuildNewGRFRailStation", 11, ".iiiiiiiiib");
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::BuildRailWaypoint, "BuildRailWaypoint", 2, ".i");
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::RemoveRailWaypoint, "RemoveRailWaypoint", 2, ".i");
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::RemoveRailWaypointTileRect, "RemoveRailWaypointTileRect", 3, ".ii");
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::RemoveRailStationTileRect, "RemoveRailStationTileRect", 3, ".ii");
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::GetRailTracks, "GetRailTracks", 2, ".i");
|
||||
SQAIRail.DefSQStaticMethod(engine, &AIRail::BuildRailTrack, "BuildRailTrack", 3, ".ii");
|
||||
|
|
Loading…
Reference in New Issue