summaryrefslogtreecommitdiff
path: root/player.h
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-09-08 10:47:39 +0000
committerbjarni <bjarni@openttd.org>2006-09-08 10:47:39 +0000
commitc545edf46f6fdd7341b563d71109eea738c75c5f (patch)
tree6807547e48700a8903229c58abafc50330747e2c /player.h
parent3d1bde020a54af2192d35451413e584acb0d6754 (diff)
downloadopenttd-c545edf46f6fdd7341b563d71109eea738c75c5f.tar.xz
(svn r6424) -Codechange: [autoreplace] removed a loop though all vehicles from each time the window is redrawn
To do this, the player struct contains an array, that contains the count of each engine type that the player owns Those arrays are updated each time a vehicle is build or deleted and is calculated on load (it's not saved) It's possible to access the arrays outside of the autoreplace GUI, so feel free to read from them in other patches as well
Diffstat (limited to 'player.h')
-rw-r--r--player.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/player.h b/player.h
index f02c801c7..55c13abce 100644
--- a/player.h
+++ b/player.h
@@ -194,6 +194,7 @@ typedef struct Player {
bool renew_keep_length;
int16 engine_renew_months;
uint32 engine_renew_money;
+ uint16 num_engines[TOTAL_NUM_ENGINES]; // caches the number of engines of each type the player owns (no need to save this)
} Player;
uint16 GetDrawStringPlayerColor(PlayerID player);