OpenTTD Source 20250428-master-ga5578166bb
TrainCache Struct Reference

Variables that are cached to improve performance and such. More...

#include <train.h>

Public Member Functions

auto operator<=> (const TrainCache &) const =default
 

Data Fields

const struct SpriteGroupcached_override = nullptr
 
bool cached_tilt = false
 train can tilt; feature provides a bonus in curves
 
uint8_t user_def_data = 0
 Cached property 0x25. Can be set by Callback 0x36.
 
int16_t cached_curve_speed_mod = 0
 curve speed modifier of the entire train
 
uint16_t cached_max_curve_speed = 0
 max consist speed limited by curves
 

Detailed Description

Variables that are cached to improve performance and such.

Definition at line 73 of file train.h.

Field Documentation

◆ cached_curve_speed_mod

int16_t TrainCache::cached_curve_speed_mod = 0

curve speed modifier of the entire train

Definition at line 81 of file train.h.

Referenced by Train::ConsistChanged(), and Train::GetCurveSpeedLimit().

◆ cached_max_curve_speed

uint16_t TrainCache::cached_max_curve_speed = 0

max consist speed limited by curves

Definition at line 82 of file train.h.

Referenced by Train::ConsistChanged(), Train::GetCurrentMaxSpeed(), and TrainController().

◆ cached_override

const struct SpriteGroup* TrainCache::cached_override = nullptr

Definition at line 75 of file train.h.

◆ cached_tilt

bool TrainCache::cached_tilt = false

train can tilt; feature provides a bonus in curves

Definition at line 78 of file train.h.

Referenced by Train::ConsistChanged(), and Train::GetCurveSpeedLimit().

◆ user_def_data

uint8_t TrainCache::user_def_data = 0

Cached property 0x25. Can be set by Callback 0x36.

Definition at line 79 of file train.h.


The documentation for this struct was generated from the following file: