diff -r 4bf29d14edba -r c30fe89622df src/station_cmd.cpp --- a/src/station_cmd.cpp Sat Mar 10 11:07:13 2007 +0000 +++ b/src/station_cmd.cpp Sun Mar 11 16:31:18 2007 +0000 @@ -330,7 +330,7 @@ } // Update the virtual coords needed to draw the station sign for all stations. -void UpdateAllStationVirtCoord(void) +void UpdateAllStationVirtCoord() { Station* st; @@ -449,12 +449,12 @@ } } -typedef struct ottd_Rectangle { +struct ottd_Rectangle { uint min_x; uint min_y; uint max_x; uint max_y; -} ottd_Rectangle; +}; static inline void MergePoint(ottd_Rectangle* rect, TileIndex tile) { @@ -1401,7 +1401,7 @@ // Intercontinental Airport (vlarge) - 4 runways static const byte _airport_sections_intercontinental[] = { 102, 120, 89, 89, 89, 89, 89, 89, 118, - 120, 22, 22, 22, 22, 22, 22, 119, 117, + 120, 23, 23, 23, 23, 23, 23, 119, 117, 87, 54, 87, 8, 8, 8, 8, 51, 117, 87, 162, 87, 85, 116, 116, 8, 9, 10, 87, 8, 8, 11, 31, 11, 8, 160, 32, @@ -1410,7 +1410,7 @@ 87, 142, 8, 11, 29, 11, 10, 163, 10, 87, 164, 87, 8, 8, 8, 10, 37, 117, 87, 120, 89, 89, 89, 89, 89, 89, 119, - 121, 22, 22, 22, 22, 22, 22, 119, 37 + 121, 23, 23, 23, 23, 23, 23, 119, 37 }; @@ -1670,7 +1670,7 @@ { const Vehicle *v; FOR_ALL_VEHICLES(v) { - if (v->type == VEH_Ship) { + if (v->type == VEH_SHIP) { const Order *order; FOR_VEHICLE_ORDERS(v, order) { if (order->type == OT_GOTO_STATION && order->dest == st->index) { @@ -2071,11 +2071,11 @@ static void AnimateTile_Station(TileIndex tile) { - typedef struct AnimData { + struct AnimData { StationGfx from; // first sprite StationGfx to; // last sprite byte delay; - } AnimData; + }; static const AnimData data[] = { { GFX_RADAR_LARGE_FIRST, GFX_RADAR_LARGE_LAST, 3 }, @@ -2103,7 +2103,7 @@ static void ClickTile_Station(TileIndex tile) { if (IsHangar(tile)) { - ShowDepotWindow(tile, VEH_Aircraft); + ShowDepotWindow(tile, VEH_AIRCRAFT); } else { ShowStationViewWindow(GetStationIndex(tile)); } @@ -2115,7 +2115,7 @@ static uint32 VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y) { - if (v->type == VEH_Train) { + if (v->type == VEH_TRAIN) { if (IsRailwayStation(tile) && IsFrontEngine(v) && !IsCompatibleTrainStationTile(tile + TileOffsByDiagDir(DirToDiagDir(v->direction)), tile)) { StationID station_id = GetStationIndex(tile); @@ -2145,7 +2145,7 @@ } } } - } else if (v->type == VEH_Road) { + } else if (v->type == VEH_ROAD) { if (v->u.road.state < RVSB_IN_ROAD_STOP && !IsReversingRoadTrackdir((Trackdir)v->u.road.state) && v->u.road.frame == 0) { if (IsRoadStop(tile)) { /* Attempt to allocate a parking bay in a road stop */ @@ -2210,6 +2210,12 @@ GoodsEntry *ge = st->goods; do { + /* Slowly increase the rating back to his original level in the case we + * didn't deliver cargo yet to this station. This happens when a bribe + * failed while you didn't moved that cargo yet to a station. */ + if (ge->enroute_from == INVALID_STATION && ge->rating < INITIAL_STATION_RATING) + ge->rating++; + /* Only change the rating if we are moving this cargo */ if (ge->enroute_from != INVALID_STATION) { byte_inc_sat(&ge->enroute_time); byte_inc_sat(&ge->days_since_pickup); @@ -2234,7 +2240,7 @@ { byte days = ge->days_since_pickup; - if (st->last_vehicle_type == VEH_Ship) + if (st->last_vehicle_type == VEH_SHIP) days >>= 2; (days > 21) || (rating += 25, days > 12) || @@ -2299,7 +2305,7 @@ if (b == 0) UpdateStationRating(st); } -void OnTick_Station(void) +void OnTick_Station() { if (_game_mode == GM_EDITOR) return; @@ -2312,7 +2318,7 @@ FOR_ALL_STATIONS(st) StationHandleSmallTick(st); } -void StationMonthlyLoop(void) +void StationMonthlyLoop() { } @@ -2537,7 +2543,7 @@ st->time_since_load = 255; st->time_since_unload = 255; st->delete_ctr = 0; - st->last_vehicle_type = VEH_Invalid; + st->last_vehicle_type = VEH_INVALID; st->facilities = FACIL_AIRPORT | FACIL_DOCK; st->build_date = _date; @@ -2546,7 +2552,7 @@ st->goods[j].days_since_pickup = 0; st->goods[j].enroute_from = INVALID_STATION; st->goods[j].enroute_from_xy = INVALID_TILE; - st->goods[j].rating = 175; + st->goods[j].rating = INITIAL_STATION_RATING; st->goods[j].last_speed = 0; st->goods[j].last_age = 255; } @@ -2643,7 +2649,7 @@ return CMD_ERROR; } -void InitializeStations(void) +void InitializeStations() { /* Clean the station pool and create 1 block in it */ CleanPool(&_Station_pool); @@ -2658,7 +2664,7 @@ } -void AfterLoadStations(void) +void AfterLoadStations() { /* Update the speclists of all stations to point to the currently loaded custom stations. */ Station *st; @@ -2814,7 +2820,7 @@ } } -static void Save_STNS(void) +static void Save_STNS() { Station *st; // Write the stations @@ -2824,7 +2830,7 @@ } } -static void Load_STNS(void) +static void Load_STNS() { int index; while ((index = SlIterateArray()) != -1) { @@ -2847,7 +2853,7 @@ if (_station_tick_ctr > GetMaxStationIndex()) _station_tick_ctr = 0; } -static void Save_ROADSTOP(void) +static void Save_ROADSTOP() { RoadStop *rs; @@ -2857,7 +2863,7 @@ } } -static void Load_ROADSTOP(void) +static void Load_ROADSTOP() { int index;