(svn r14528) -Codechange: cache the closest town for all road tiles instead of only roads owned by tiles. This replaces a O(n) search over all towns from the road's tileloop with a O(1) lookup (PhilSophus)
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
#include "tree_map.h"
|
||||
#include "rail_map.h"
|
||||
#include "road_map.h"
|
||||
#include "road_cmd.h"
|
||||
#include "station_map.h"
|
||||
#include "town_map.h"
|
||||
#include "industry_map.h"
|
||||
@@ -2561,6 +2562,9 @@ bool AfterLoadGame()
|
||||
}
|
||||
|
||||
if (CheckSavegameVersion(103)) {
|
||||
/* Non-town-owned roads now store the closest town */
|
||||
InvalidateTownForRoadTile();
|
||||
|
||||
/* signs with invalid owner left from older savegames */
|
||||
Sign *si;
|
||||
FOR_ALL_SIGNS(si) {
|
||||
|
Reference in New Issue
Block a user