From b0093cab92f00797f2e194db3028045d2cf5a648 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 17 Jul 2017 08:31:09 +1000 Subject: [PATCH] Clean up W_RandomWeapons a bit --- qcsrc/common/weapons/all.qc | 11 ++++------- qcsrc/common/weapons/weapon.qh | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) 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); -- 2.39.2