mirror of
https://github.com/ineedbots/t5_bot_warfare.git
synced 2025-04-19 16:32:53 +00:00
FIx crash from var usage
This commit is contained in:
parent
bd0411c50c
commit
190271f3ca
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user