summaryrefslogtreecommitdiff
path: root/src/vehicle_base.h
diff options
context:
space:
mode:
authorMatt Kimber <github@mattkimber.org.uk>2021-01-03 14:02:53 +0000
committerPatric Stout <github@truebrain.nl>2021-01-05 11:42:25 +0100
commit5728f9c7d09327ddc11c779b951688ea32b4b725 (patch)
treee2079a3684ad99bc8987a8c10ffd9161999bb63d /src/vehicle_base.h
parent9b28b15e677e0de64fde270f4223daeb401cfcac (diff)
downloadopenttd-5728f9c7d09327ddc11c779b951688ea32b4b725.tar.xz
Codechange: consider vehicle co-ordinates when identifying viewport candidate as using only the hash generates false positives
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r--src/vehicle_base.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h
index d6a02cc0c..24facfb3e 100644
--- a/src/vehicle_base.h
+++ b/src/vehicle_base.h
@@ -186,10 +186,10 @@ struct VehicleSpriteSeq {
* or calculating the viewport.
*/
struct MutableSpriteCache {
- Direction last_direction; ///< Last direction we obtained sprites for
- mutable bool is_viewport_candidate; ///< The vehicle has been in the hash for a shown viewport recently
- mutable bool sprite_has_viewport_changes; ///< There have been viewport changes since the sprite was last updated
- mutable VehicleSpriteSeq sprite_seq; ///< Vehicle appearance.
+ Direction last_direction; ///< Last direction we obtained sprites for
+ bool is_viewport_candidate; ///< The vehicle has been in the hash for a shown viewport recently
+ bool sprite_has_viewport_changes; ///< There have been viewport changes since the sprite was last updated
+ VehicleSpriteSeq sprite_seq; ///< Vehicle appearance.
};
/** A vehicle pool for a little over 1 million vehicles. */
@@ -337,7 +337,7 @@ public:
NewGRFCache grf_cache; ///< Cache of often used calculated NewGRF values
VehicleCache vcache; ///< Cache of often used vehicle values.
- MutableSpriteCache sprite_cache; ///< Cache of sprites and values related to recalculating them, see #MutableSpriteCache
+ mutable MutableSpriteCache sprite_cache; ///< Cache of sprites and values related to recalculating them, see #MutableSpriteCache
Vehicle(VehicleType type = VEH_INVALID);