diff options
author | rubidium <rubidium@openttd.org> | 2007-09-16 20:48:00 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-09-16 20:48:00 +0000 |
commit | 9da9e77641b81b91bd6facd0f889b6ce906a7b40 (patch) | |
tree | 3b80369d0f59fffcf4e114f44cfe11145c5ad9b8 /src/roadveh_cmd.cpp | |
parent | 631dc06212b279edf696698cbe425bb8a2980ac0 (diff) | |
download | openttd-9da9e77641b81b91bd6facd0f889b6ce906a7b40.tar.xz |
(svn r11120) -Codechange: remove the arbitrary limit of 10 articulated parts for a vehicle.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 7e46f9de6..9f7b31630 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -181,9 +181,9 @@ CommandCost CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) uint num_vehicles = 1 + CountArticulatedParts(p1); - /* Allow for the front and up to 10 articulated parts. */ - Vehicle *vl[11]; - memset(&vl, 0, sizeof(vl)); + /* Allow for the front and the articulated parts. */ + Vehicle **vl = (Vehicle**)alloca(sizeof(*vl) * num_vehicles); + memset(vl, 0, sizeof(*vl) * num_vehicles); if (!Vehicle::AllocateList(vl, num_vehicles)) { return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME); |