FIx crash from var usage

This commit is contained in:
INeedBots 2021-01-18 01:32:30 -06:00
parent bd0411c50c
commit 190271f3ca

View File

@ -1558,15 +1558,11 @@ getRocketAmmo()
if (isDefined(answer)) if (isDefined(answer))
return answer; return answer;
weapons = []; if (self GetAmmoCount("minigun_mp"))
weapons[0] = "minigun_mp"; return "minigun_mp";
weapons[1] = "rpg_mp";
for (i = 0; i < weapons.size; i++) if (self GetAmmoCount("rpg_mp"))
{ return "rpg_mp";
if (self GetAmmoCount(weapons[i]))
return weapons[i];
}
return undefined; return undefined;
} }
@ -1576,16 +1572,14 @@ getRocketAmmo()
*/ */
getLockonAmmo() getLockonAmmo()
{ {
weapons = []; if (self GetAmmoCount("m72_law_mp"))
weapons[0] = "m72_law_mp"; return "m72_law_mp";
weapons[1] = "strela_mp";
weapons[2] = "m202_flash_mp";
for (i = 0; i < weapons.size; i++) if (self GetAmmoCount("strela_mp"))
{ return "strela_mp";
if (self GetAmmoCount(weapons[i]))
return weapons[i]; if (self GetAmmoCount("m202_flash_mp"))
} return "m202_flash_mp";
return undefined; return undefined;
} }