diff -r 8f2b44f6b709 -r e6fc916c17ab station_cmd.c --- a/station_cmd.c Thu May 11 09:54:11 2006 +0000 +++ b/station_cmd.c Thu May 11 10:33:58 2006 +0000 @@ -495,7 +495,6 @@ st->random_bits = Random(); st->waiting_triggers = 0; - _global_station_sort_dirty = true; // build a new station } // Update the virtual coords needed to draw the station sign. @@ -769,6 +768,7 @@ { if (st->facilities == 0) { st->delete_ctr = 0; + RebuildStationLists(); InvalidateWindow(WC_STATION_LIST, st->owner); } } @@ -1119,6 +1119,7 @@ UpdateStationVirtCoordDirty(st); UpdateStationAcceptance(st, false); + RebuildStationLists(); InvalidateWindow(WC_STATION_LIST, st->owner); } @@ -1465,6 +1466,7 @@ UpdateStationVirtCoordDirty(st); UpdateStationAcceptance(st, false); + RebuildStationLists(); InvalidateWindow(WC_STATION_LIST, st->owner); } return cost; @@ -1703,6 +1705,7 @@ UpdateStationVirtCoordDirty(st); UpdateStationAcceptance(st, false); + RebuildStationLists(); InvalidateWindow(WC_STATION_LIST, st->owner); } @@ -1789,8 +1792,8 @@ MakeBuoy(tile, st->index); UpdateStationVirtCoordDirty(st); - UpdateStationAcceptance(st, false); + RebuildStationLists(); InvalidateWindow(WC_STATION_LIST, st->owner); } @@ -1946,6 +1949,7 @@ UpdateStationVirtCoordDirty(st); UpdateStationAcceptance(st, false); + RebuildStationLists(); InvalidateWindow(WC_STATION_LIST, st->owner); } return _price.build_dock; @@ -2320,7 +2324,7 @@ DeleteName(st->string_id); MarkStationDirty(st); - _global_station_sort_dirty = true; // delete station, remove sign + RebuildStationLists(); InvalidateWindowClasses(WC_STATION_LIST); index = st->index; @@ -2557,7 +2561,7 @@ st->string_id = str; UpdateStationVirtCoord(st); DeleteName(old_str); - _station_sort_dirty[st->owner] = true; // rename a station + ResortStationLists(); MarkWholeScreenDirty(); } else { DeleteName(str); @@ -2776,7 +2780,7 @@ SetTileOwner(tile, new_player); st->owner = new_player; - _global_station_sort_dirty = true; // transfer ownership of station to another player + RebuildStationLists(); InvalidateWindowClasses(WC_STATION_LIST); } else { DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); @@ -2830,9 +2834,6 @@ _station_tick_ctr = 0; - // set stations to be sorted on load of savegame - memset(_station_sort_dirty, true, sizeof(_station_sort_dirty)); - _global_station_sort_dirty = true; // load of savegame }