Changeset - r12501:e56066b7af18
[Not reviewed]
master
0 3 0
rubidium - 15 years ago 2009-07-25 10:39:58
rubidium@openttd.org
(svn r16948) -Codechange: some code reductions and usage of wrapper functions
3 files changed with 6 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/ai/api/ai_order.cpp
Show inline comments
 
@@ -198,7 +198,7 @@ static const Order *ResolveOrder(Vehicle
 
			}
 
			return INVALID_TILE;
 
		}
 
		case OT_GOTO_WAYPOINT: return v->type == VEH_TRAIN ? ::Waypoint::Get(order->GetDestination())->xy : ::Station::Get(order->GetDestination())->xy;
 
		case OT_GOTO_WAYPOINT: return ::Waypoint::Get(order->GetDestination())->xy;
 
		default:               return INVALID_TILE;
 
	}
 
}
src/station_cmd.cpp
Show inline comments
 
@@ -352,7 +352,7 @@ static Station *GetClosestDeletedStation
 
	Station *st;
 

	
 
	FOR_ALL_STATIONS(st) {
 
		if (st->facilities == 0 && st->owner == _current_company) {
 
		if (!st->IsInUse() && st->owner == _current_company) {
 
			uint cur_dist = DistanceManhattan(tile, st->xy);
 

	
 
			if (cur_dist < threshold) {
 
@@ -420,11 +420,7 @@ void UpdateAllStationVirtCoords()
 
{
 
	BaseStation *st;
 

	
 
	FOR_ALL_STATIONS(st) {
 
		st->UpdateVirtCoord();
 
	}
 

	
 
	FOR_ALL_WAYPOINTS(st) {
 
	FOR_ALL_BASE_STATIONS(st) {
 
		st->UpdateVirtCoord();
 
	}
 
}
 
@@ -628,7 +624,7 @@ static void UpdateStationSignCoord(Stati
 
 */
 
static void DeleteStationIfEmpty(Station *st)
 
{
 
	if (st->facilities == 0) {
 
	if (!st->IsInUse()) {
 
		st->delete_ctr = 0;
 
		InvalidateWindowData(WC_STATION_LIST, st->owner, 0);
 
	}
 
@@ -2951,7 +2947,7 @@ void DeleteOilRig(TileIndex tile)
 

	
 
	st->UpdateVirtCoord();
 
	st->RecomputeIndustriesNear();
 
	if (st->facilities == 0) delete st;
 
	if (!st->IsInUse()) delete st;
 
}
 

	
 
static void ChangeTileOwner_Station(TileIndex tile, Owner old_owner, Owner new_owner)
src/viewport.cpp
Show inline comments
 
@@ -1092,7 +1092,7 @@ static void ViewportAddTownNames(DrawPix
 

	
 
static void AddStation(const Station *st, StringID str, uint16 width)
 
{
 
	AddStringToDraw(st->sign.left + 1, st->sign.top + 1, str, st->index, st->facilities, (st->owner == OWNER_NONE || st->facilities == 0) ? 0xE : _company_colours[st->owner], width);
 
	AddStringToDraw(st->sign.left + 1, st->sign.top + 1, str, st->index, st->facilities, (st->owner == OWNER_NONE || !st->IsInUse()) ? 0xE : _company_colours[st->owner], width);
 
}
 

	
 

	
0 comments (0 inline, 0 general)