diff options
author | Darkvater <Darkvater@openttd.org> | 2006-12-21 10:29:16 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2006-12-21 10:29:16 +0000 |
commit | dbb36b67d812bc3b8bd7b84abe378478d5e79ea4 (patch) | |
tree | f8281d852173843541f4573083830e5d73025495 /vehicle.c | |
parent | 5cd081b6cd357ab1774091a680183eb5ba69ebc3 (diff) | |
download | openttd-dbb36b67d812bc3b8bd7b84abe378478d5e79ea4.tar.xz |
(svn r7523) -Feature: Add the possibility to change the newgrf configuration of a running game.
This is only possible in SP (or in the intro menu). During game play you will
get a confirmation window when applying the changes as some actions can crash
OpenTTD and/or make your current game unplayable.
Diffstat (limited to 'vehicle.c')
-rw-r--r-- | vehicle.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -440,6 +440,14 @@ static void UpdateVehiclePosHash(Vehicle* v, int x, int y) } } +void ResetVehiclePosHash(void) +{ + uint i; + for (i = 0; i < lengthof(_vehicle_position_hash); i++) { + _vehicle_position_hash[i] = INVALID_VEHICLE; + } +} + void InitializeVehicles(void) { uint i; @@ -449,12 +457,11 @@ void InitializeVehicles(void) * vehicles (which is increased on-the-fly) */ CleanPool(&_Vehicle_pool); AddBlockToPool(&_Vehicle_pool); - for (i = 0; i < BLOCKS_FOR_SPECIAL_VEHICLES; i++) + for (i = 0; i < BLOCKS_FOR_SPECIAL_VEHICLES; i++) { AddBlockToPool(&_Vehicle_pool); - - for (i = 0; i < lengthof(_vehicle_position_hash); i++) { - _vehicle_position_hash[i] = INVALID_VEHICLE; } + + ResetVehiclePosHash(); } Vehicle *GetLastVehicleInChain(Vehicle *v) |