diff options
author | smatz <smatz@openttd.org> | 2008-05-14 15:29:48 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-05-14 15:29:48 +0000 |
commit | e4dee736c5d113c2143e93eb4931095e1e508d14 (patch) | |
tree | d8f32e0f77faa771a8fb4a73724c598581994d34 /src | |
parent | c09737a3e183a40199a94e3126eef0323c7afff3 (diff) | |
download | openttd-e4dee736c5d113c2143e93eb4931095e1e508d14.tar.xz |
(svn r13086) -Fix: do not crash badly after loading a newgrf with engines in-game that often
Diffstat (limited to 'src')
-rw-r--r-- | src/engine.cpp | 3 | ||||
-rw-r--r-- | src/openttd.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 818cd2d6e..4a548b967 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -141,6 +141,9 @@ void EngList_SortPartial(EngineList *el, EngList_SortTypeFunction compare, uint qsort(&((*el)[begin]), num_items, sizeof(EngineID), compare); } + +/** Sets cached values in Player::num_vehicles and Group::num_vehicles + */ void SetCachedEngineCounts() { uint engines = GetEnginePoolSize(); diff --git a/src/openttd.cpp b/src/openttd.cpp index f32d338d6..e79b166fc 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -2538,6 +2538,7 @@ void ReloadNewGRFData() ResetVehiclePosHash(); AfterLoadVehicles(false); StartupEngines(); + SetCachedEngineCounts(); /* update station and waypoint graphics */ AfterLoadWaypoints(); AfterLoadStations(); |