mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-12 09:09:09 +00:00
(svn r18406) -Cleanup: remove some unneeded constants and code
This commit is contained in:
@@ -65,11 +65,9 @@ struct RoadStop : RoadStopPool::PoolItem<&_roadstop_pool> {
|
|||||||
void Rebuild(const RoadStop *rs, int side = -1);
|
void Rebuild(const RoadStop *rs, int side = -1);
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint LIMIT = 16; ///< The maximum amount of roadstops that are allowed at a single station
|
TileIndex xy; ///< Position on the map
|
||||||
|
byte status; ///< Current status of the Stop, @see RoadStopSatusFlag. Access using *Bay and *Busy functions.
|
||||||
TileIndex xy; ///< Position on the map
|
struct RoadStop *next; ///< Next stop of the given type at this station
|
||||||
byte status; ///< Current status of the Stop, @see RoadStopSatusFlag. Access using *Bay and *Busy functions.
|
|
||||||
struct RoadStop *next; ///< Next stop of the given type at this station
|
|
||||||
|
|
||||||
/** Initializes a RoadStop */
|
/** Initializes a RoadStop */
|
||||||
FORCEINLINE RoadStop(TileIndex tile = INVALID_TILE) :
|
FORCEINLINE RoadStop(TileIndex tile = INVALID_TILE) :
|
||||||
|
@@ -71,18 +71,6 @@ bool IsHangar(TileIndex t)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint GetNumRoadStopsInStation(const Station *st, RoadStopType type)
|
|
||||||
{
|
|
||||||
uint num = 0;
|
|
||||||
|
|
||||||
assert(st != NULL);
|
|
||||||
for (const RoadStop *rs = st->GetPrimaryRoadStop(type); rs != NULL; rs = rs->next) {
|
|
||||||
num++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return num;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Look for a station around the given tile area.
|
* Look for a station around the given tile area.
|
||||||
* @param ta the area to search over
|
* @param ta the area to search over
|
||||||
@@ -1589,11 +1577,6 @@ CommandCost CmdBuildRoadStop(TileIndex tile, DoCommandFlag flags, uint32 p1, uin
|
|||||||
/* give us a road stop in the list, and check if something went wrong */
|
/* give us a road stop in the list, and check if something went wrong */
|
||||||
if (!RoadStop::CanAllocateItem()) return_cmd_error(type ? STR_ERROR_TOO_MANY_TRUCK_STOPS : STR_ERROR_TOO_MANY_BUS_STOPS);
|
if (!RoadStop::CanAllocateItem()) return_cmd_error(type ? STR_ERROR_TOO_MANY_TRUCK_STOPS : STR_ERROR_TOO_MANY_BUS_STOPS);
|
||||||
|
|
||||||
if (st != NULL &&
|
|
||||||
GetNumRoadStopsInStation(st, ROADSTOP_BUS) + GetNumRoadStopsInStation(st, ROADSTOP_TRUCK) >= RoadStop::LIMIT) {
|
|
||||||
return_cmd_error(type ? STR_ERROR_TOO_MANY_TRUCK_STOPS : STR_ERROR_TOO_MANY_BUS_STOPS);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (st != NULL) {
|
if (st != NULL) {
|
||||||
if (st->owner != _current_company) {
|
if (st->owner != _current_company) {
|
||||||
return_cmd_error(STR_ERROR_TOO_CLOSE_TO_ANOTHER_STATION);
|
return_cmd_error(STR_ERROR_TOO_CLOSE_TO_ANOTHER_STATION);
|
||||||
|
Reference in New Issue
Block a user