This is the patch so far:
Code: Select all
Index: Sim/Units/COB/CobFile.cpp
===================================================================
--- Sim/Units/COB/CobFile.cpp (revision 5501)
+++ Sim/Units/COB/CobFile.cpp (working copy)
@@ -187,7 +187,7 @@
// Also add the weapon aiming stuff
for (int i = 0; i < COB_MaxWeapons; ++i) {
- char buf[15];
+ char buf[COB_MaxWeapons - 1];
sprintf(buf, "Weapon%d", i + 1);
string weapon(buf);
sprintf(buf, "%d", i + 1);
Index: Sim/Units/COB/CobFile.h
===================================================================
--- Sim/Units/COB/CobFile.h (revision 5501)
+++ Sim/Units/COB/CobFile.h (working copy)
@@ -40,7 +40,7 @@
const int COBFN_Last = 16; //Make sure to update this, so the array will be sized properly
// These are special (they need space for MaxWeapons of each)
-const int COB_MaxWeapons = 16;
+const int COB_MaxWeapons = 32;
const int COBFN_QueryPrimary = COBFN_Last;
const int COBFN_AimPrimary = COBFN_QueryPrimary + COB_MaxWeapons;
const int COBFN_AimFromPrimary = COBFN_AimPrimary + COB_MaxWeapons;
Index: Sim/Units/UnitDefHandler.cpp
===================================================================
--- Sim/Units/UnitDefHandler.cpp (revision 5501)
+++ Sim/Units/UnitDefHandler.cpp (working copy)
@@ -492,7 +492,7 @@
const WeaponDef* noWeaponDef = weaponDefHandler->GetWeapon("NOWEAPON");
LuaTable weaponsTable = udTable.SubTable("weapons");
- for (int w = 0; w < 16; w++) {
+ for (int w = 0; w < 32; w++) {
LuaTable wTable;
string name = weaponsTable.GetString(w + 1, "");
if (name.empty()) {