OpenTTD Source 20250205-master-gfd85ab1e2c
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 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, CargoList< Tinst, Tcont >::InvalidateCache(), IsBayRoadStopTile(), IsDockingTile(), SpecializedStation< Station, false >::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<&_roadstop_pool >::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<&_town_pool >::Iterate(), Vehicle::Next(), CargoList< Tinst, Tcont >::PeriodsInTransit(), RebuildSubsidisedSourceAndDestinationCache(), RebuildTownCaches(), Station::RecomputeCatchmentForAll(), RoadVehUpdateCache(), OrthogonalTileArea::tile, StationCargoList::TotalCount(), UpdateAircraftCache(), Ship::UpdateCache(), VEH_AIRCRAFT, VEH_ROAD, VEH_SHIP, VEH_TRAIN, VS_CRASHED, and OrthogonalTileArea::w.

Referenced by StateGameLoop().

◆ RebuildTownCaches()