Changeset - r1064:4805a9877239
[Not reviewed]
master
0 2 0
celestar - 20 years ago 2005-01-19 10:00:37
celestar@openttd.org
(svn r1565) -Fix: [ 1104969 ] Aircraft in hangar messages are now revalidated before
display
-CodeChange: replaced one if (foo) return true else return false by
return (foo)
2 files changed with 11 insertions and 6 deletions:
0 comments (0 inline, 0 general)
aircraft_cmd.c
Show inline comments
 
@@ -1190,24 +1190,31 @@ static void AircraftEntersTerminal(Vehic
 
	if (old_order.type == OT_GOTO_STATION &&
 
			v->current_order.station == v->last_station_visited) {
 
		v->current_order.flags =
 
			(old_order.flags & (OF_FULL_LOAD | OF_UNLOAD)) | OF_NON_STOP;
 
	}
 

	
 
	SET_EXPENSES_TYPE(EXPENSES_AIRCRAFT_INC);
 
	LoadUnloadVehicle(v);
 
	InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
 
	InvalidateWindowClasses(WC_AIRCRAFT_LIST);
 
}
 

	
 
static bool ValidateAircraftInHangar( uint data_a, uint data_b )
 
{
 
	Vehicle *v = GetVehicle(data_a);
 

	
 
	return (IsAircraftHangarTile(v->tile) && (v->vehstatus & VS_STOPPED));
 
}
 

	
 
static void AircraftEnterHangar(Vehicle *v)
 
{
 
	Order old_order;
 

	
 
	ServiceAircraft(v);
 
	InvalidateWindowClasses(WC_AIRCRAFT_LIST);
 

	
 
	MaybeReplaceVehicle(v);
 

	
 
	TriggerVehicle(v, VEHICLE_TRIGGER_DEPOT);
 

	
 
	if (v->current_order.type == OT_GOTO_DEPOT) {
 
@@ -1216,29 +1223,30 @@ static void AircraftEnterHangar(Vehicle 
 
		old_order = v->current_order;
 
		v->current_order.type = OT_NOTHING;
 
		v->current_order.flags = 0;
 

	
 
		if (old_order.flags & OF_UNLOAD) {
 
			v->cur_order_index++;
 
		} else if (old_order.flags & OF_FULL_LOAD) { // force depot visit
 
			v->vehstatus |= VS_STOPPED;
 
			InvalidateWindowClasses(WC_AIRCRAFT_LIST);
 

	
 
			if (v->owner == _local_player) {
 
				SetDParam(0, v->unitnumber);
 
				AddNewsItem(
 
				AddValidatedNewsItem(
 
					STR_A014_AIRCRAFT_IS_WAITING_IN,
 
					NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0),
 
					v->index,
 
					0);
 
					0,
 
					ValidateAircraftInHangar);
 
			}
 
		}
 
	}
 
}
 

	
 
static void AircraftLand(Vehicle *v)
 
{
 
	v->sprite_width = v->sprite_height = 2;
 
}
 

	
 
static void AircraftLandAirplane(Vehicle *v)
 
{
train_cmd.c
Show inline comments
 
@@ -2613,28 +2613,25 @@ void Train_Tick(Vehicle *v)
 
		if (v->type == VEH_Train && v->subtype == 0)
 
			TrainLocoHandler(v, true);
 
	}
 
}
 

	
 

	
 
static const byte _depot_track_ind[4] = {0,1,0,1};
 

	
 
// Validation for the news item "Train is waiting in depot"
 
bool ValidateTrainInDepot( uint data_a, uint data_b )
 
{
 
	Vehicle *v = GetVehicle(data_a);
 
	if (v->u.rail.track == 0x80 && (v->vehstatus | VS_STOPPED))
 
		return true;
 
	else
 
		return false;
 
	return  (v->u.rail.track == 0x80 && (v->vehstatus | VS_STOPPED));
 
}
 

	
 
void TrainEnterDepot(Vehicle *v, uint tile)
 
{
 
	SetSignalsOnBothDir(tile, _depot_track_ind[_map5[tile]&3]);
 

	
 
	if (v->subtype != 0)
 
		v = GetFirstVehicleInChain(v);
 

	
 
	VehicleServiceInDepot(v);
 

	
 
	InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
0 comments (0 inline, 0 general)