OpenTTD Source: src/cachecheck.cpp File Reference

OpenTTD Source 15.0-beta1

Functions
cachecheck.cpp File Reference

Check caches. More...

`#include "stdafx.h"`
`#include "aircraft.h"`
`#include "company_base.h"`
`#include "debug.h"`
`#include "industry.h"`
`#include "roadstop_base.h"`
`#include "roadveh.h"`
`#include "ship.h"`
`#include "station_base.h"`
`#include "station_map.h"`
`#include "subsidy_func.h"`
`#include "town.h"`
`#include "train.h"`
`#include "vehicle_base.h"`
`#include "safeguards.h"`

Go to the source code of this file.

## Functions
void | AfterLoadCompanyStats ()
| Rebuilding of company statistics after loading a savegame.
void | RebuildTownCaches ()
| Rebuild all the cached variables of towns.
void | CheckCaches ()
| Check the validity of some of the caches.

## Detailed Description

Check caches.

Definition in file cachecheck.cpp.

## Function Documentation

## ◆ AfterLoadCompanyStats()

void AfterLoadCompanyStats | ( |  | ) |
| extern

Rebuilding of company statistics after loading a savegame.

Definition at line 96 of file company_sl.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Iterate().

Referenced by AfterLoadGame(), CheckCaches(), and ReloadNewGRFData().

## ◆ CheckCaches()

void CheckCaches | ( |  | ) |

Check the validity of some of the caches.

Especially in the sense of desyncs between the cached value and what the value would be when calculated from the 'base' data.

Definition at line 36 of file cachecheck.cpp.

References OrthogonalTileArea::Add(), AfterLoadCompanyStats(), CCF_TRACK, Debug, DIAGDIR_NE, DIAGDIR_NW, FillNewGRFVehicleCache(), SpecializedVehicle< Ship, VEH_SHIP >::From(), SpecializedVehicle< T, Type >::From(), SpecializedVehicle< Aircraft, VEH_AIRCRAFT >::From(), OrthogonalTileArea::h, IsBayRoadStopTile(), IsDockingTile(), SpecializedStation< Station, false >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_industry_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_vehicle_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_town_pool >::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_roadstop_pool >::Iterate(), Vehicle::Next(), RebuildSubsidisedSourceAndDestinationCache(), RebuildTownCaches(), Station::RecomputeCatchmentForAll(), RoadVehUpdateCache(), OrthogonalTileArea::tile, UpdateAircraftCache(), Ship::UpdateCache(), VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, VEH_TRAIN, VS_CRASHED, and OrthogonalTileArea::w.

Referenced by StateGameLoop().

## ◆ RebuildTownCaches()

void RebuildTownCaches | ( |  | ) |
| extern

Rebuild all the cached variables of towns.

Definition at line 27 of file town_sl.cpp.

References Town::cache, HouseSpec::Get(), GetHouseNorthPart(), GetHouseType(), IncreaseBuildingCount(), InitializeBuildingCounts(), IsHouseCompleted(), IsTileType(), Map::Iterate(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_town_pool >::Iterate(), MP_HOUSE, TownCache::num_houses, HouseSpec::population, TownCache::population, TileDiffXY(), and UpdateTownRadius().

Referenced by CheckCaches(), and UpdateHousesAndTowns().