# HG changeset patch # User tron # Date 1169797834 0 # Node ID ad29de8c686059f15b3b1bd26f130bb2292f5520 # Parent 21f2934dee5c1c1a69bc27cbe3edf3c7e54e37fd (svn r8410) -Fix -Fix: Fix an out of bounds array access when assigning the engine type in the _engine array This usually hits the _engine_name_strings array and causes an invalid StringID, though it depends on the compiler which data structure gets placed after the _engines array. Most probably this was exposed by removing railtype from Engine, which changed the size of this struct. diff -r 21f2934dee5c -r ad29de8c6860 src/engine.cpp --- a/src/engine.cpp Fri Jan 26 00:25:39 2007 +0000 +++ b/src/engine.cpp Fri Jan 26 07:50:34 2007 +0000 @@ -113,7 +113,6 @@ do e->type = VEH_Road; while (++e < &_engines[SHIP_ENGINES_INDEX]); do e->type = VEH_Ship; while (++e < &_engines[AIRCRAFT_ENGINES_INDEX]); do e->type = VEH_Aircraft; while (++e < &_engines[TOTAL_NUM_ENGINES]); - do e->type = VEH_Special; while (++e < endof(_engines)); } void StartupEngines(void)