# HG changeset patch # User celestar # Date 2005-01-19 10:00:37 # Node ID 4805a987723969ae266c4b519a83b0be8311e245 # Parent 64988ee601b913444bba00dce7504c4cf9e877e8 (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) diff --git a/aircraft_cmd.c b/aircraft_cmd.c --- a/aircraft_cmd.c +++ b/aircraft_cmd.c @@ -1199,6 +1199,13 @@ static void AircraftEntersTerminal(Vehic 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; @@ -1225,11 +1232,12 @@ static void AircraftEnterHangar(Vehicle 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); } } } diff --git a/train_cmd.c b/train_cmd.c --- a/train_cmd.c +++ b/train_cmd.c @@ -2622,10 +2622,7 @@ static const byte _depot_track_ind[4] = 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)