mirror of https://github.com/OpenTTD/OpenTTD
(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)release/0.4.5
parent
a6d1544447
commit
941da5dc94
|
@ -1199,6 +1199,13 @@ static void AircraftEntersTerminal(Vehicle *v)
|
||||||
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
|
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)
|
static void AircraftEnterHangar(Vehicle *v)
|
||||||
{
|
{
|
||||||
Order old_order;
|
Order old_order;
|
||||||
|
@ -1225,11 +1232,12 @@ static void AircraftEnterHangar(Vehicle *v)
|
||||||
|
|
||||||
if (v->owner == _local_player) {
|
if (v->owner == _local_player) {
|
||||||
SetDParam(0, v->unitnumber);
|
SetDParam(0, v->unitnumber);
|
||||||
AddNewsItem(
|
AddValidatedNewsItem(
|
||||||
STR_A014_AIRCRAFT_IS_WAITING_IN,
|
STR_A014_AIRCRAFT_IS_WAITING_IN,
|
||||||
NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0),
|
NEWS_FLAGS(NM_SMALL, NF_VIEWPORT|NF_VEHICLE, NT_ADVICE, 0),
|
||||||
v->index,
|
v->index,
|
||||||
0);
|
0,
|
||||||
|
ValidateAircraftInHangar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2622,10 +2622,7 @@ static const byte _depot_track_ind[4] = {0,1,0,1};
|
||||||
bool ValidateTrainInDepot( uint data_a, uint data_b )
|
bool ValidateTrainInDepot( uint data_a, uint data_b )
|
||||||
{
|
{
|
||||||
Vehicle *v = GetVehicle(data_a);
|
Vehicle *v = GetVehicle(data_a);
|
||||||
if (v->u.rail.track == 0x80 && (v->vehstatus | VS_STOPPED))
|
return (v->u.rail.track == 0x80 && (v->vehstatus | VS_STOPPED));
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrainEnterDepot(Vehicle *v, uint tile)
|
void TrainEnterDepot(Vehicle *v, uint tile)
|
||||||
|
|
Loading…
Reference in New Issue