From: Mario Date: Sun, 16 Jul 2017 22:31:09 +0000 (+1000) Subject: Clean up W_RandomWeapons a bit X-Git-Tag: xonotic-v0.8.5~2585 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b0093cab92f00797f2e194db3028045d2cf5a648;p=xonotic%2Fxonotic-data.pk3dir.git Clean up W_RandomWeapons a bit --- diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 94deed551..9efbb29a2 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -192,14 +192,11 @@ string W_FixWeaponOrder_ForceComplete(string order) return W_FixWeaponOrder(order, 1); } -void W_RandomWeapons(entity e, float n) +void W_RandomWeapons(entity e, int n) { - int i; - WepSet remaining; - WepSet result; - remaining = e.weapons; - result = '0 0 0'; - for (i = 0; i < n; ++i) + WepSet remaining = e.weapons; + WepSet result = '0 0 0'; + for (int j = 0; j < n; ++j) { RandomSelection_Init(); FOREACH(Weapons, it != WEP_Null, { diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 634fbf812..163326343 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -208,7 +208,7 @@ string W_NumberWeaponOrder(string order); string W_FixWeaponOrder_BuildImpulseList(string o); string W_FixWeaponOrder_AllowIncomplete(entity this, string order); string W_FixWeaponOrder_ForceComplete(string order); -void W_RandomWeapons(entity e, float n); +void W_RandomWeapons(entity e, int n); string GetAmmoPicture(.int ammotype);