mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-10 07:08:06 -05:00
Mule Kick: fix weapon slots
Value undefined cannot be added to an array
This commit is contained in:
@ -2753,25 +2753,10 @@ additionalprimaryweapon_update_weapon_slots()
|
|||||||
{
|
{
|
||||||
if (!self hasWeapon(self.weapon_slots[i]))
|
if (!self hasWeapon(self.weapon_slots[i]))
|
||||||
{
|
{
|
||||||
self.weapon_slots[i] = undefined;
|
self.weapon_slots[i] = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
weapon_slots = [];
|
|
||||||
|
|
||||||
// remove any trailing undefined slots
|
|
||||||
for (i = self.weapon_slots.size - 1; i >= 0; i--)
|
|
||||||
{
|
|
||||||
if (isDefined(self.weapon_slots[i]))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
weapon_slots[i] = self.weapon_slots[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
self.weapon_slots = weapon_slots;
|
|
||||||
|
|
||||||
for (i = 0; i < vars["primaries_that_can_be_taken"].size; i++)
|
for (i = 0; i < vars["primaries_that_can_be_taken"].size; i++)
|
||||||
{
|
{
|
||||||
vars["weapon"] = vars["primaries_that_can_be_taken"][i];
|
vars["weapon"] = vars["primaries_that_can_be_taken"][i];
|
||||||
@ -2782,7 +2767,7 @@ additionalprimaryweapon_update_weapon_slots()
|
|||||||
|
|
||||||
for (j = 0; j < self.weapon_slots.size; j++)
|
for (j = 0; j < self.weapon_slots.size; j++)
|
||||||
{
|
{
|
||||||
if (!isDefined(self.weapon_slots[j]))
|
if (self.weapon_slots[j] == "none")
|
||||||
{
|
{
|
||||||
vars["added"] = 1;
|
vars["added"] = 1;
|
||||||
self.weapon_slots[j] = vars["weapon"];
|
self.weapon_slots[j] = vars["weapon"];
|
||||||
@ -2801,7 +2786,7 @@ additionalprimaryweapon_update_weapon_slots()
|
|||||||
|
|
||||||
for (i = 0; i < self.weapon_slots.size; i++)
|
for (i = 0; i < self.weapon_slots.size; i++)
|
||||||
{
|
{
|
||||||
if (isDefined(self.weapon_slots[i]))
|
if (self.weapon_slots[i] != "none")
|
||||||
{
|
{
|
||||||
vars["num_weapons"]++;
|
vars["num_weapons"]++;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user