X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fselection.qc;h=8ec11925f2cb9bd983453287c1cbbdc2f115dd42;hb=845401fd312c66c059aaee1772ac5d79555ab4fc;hp=12ffbb9b49bd17d2f5f664bd824dc99f97352767;hpb=935f38b6d41fb6e2579a4ee1e7c6fb0d063e5869;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 12ffbb9b4..8ec11925f 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -26,7 +26,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) { if (complain) sprint(self, "Invalid weapon\n"); - return FALSE; + return false; } if (cl.weapons & WepSet_FromWeapon(wpn)) { @@ -59,10 +59,10 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) play2(cl, "weapons/unavailable.wav"); Send_WeaponComplain (cl, wpn, 0); } - return FALSE; + return false; } } - return TRUE; + return true; } if (complain) { @@ -85,7 +85,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) WaypointSprite_Spawn( (get_weaponinfo(wpn)).wpmodel, 1, 0, - world, e.origin + ('0 0 1' * e.maxs_z) * 1.2, + world, e.origin + ('0 0 1' * e.maxs.z) * 1.2, self, 0, world, enemy, 0, @@ -101,7 +101,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain) play2(cl, "weapons/unavailable.wav"); } - return FALSE; + return false; } float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, float complain, float skipmissing) @@ -136,13 +136,13 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa if(wep.impulse != imp) continue; - float i, have_other = FALSE; + float i, have_other = false; for(i = WEP_FIRST; i <= WEP_LAST; ++i) { if(i != weaponwant) if((get_weaponinfo(i)).impulse == imp || imp < 0) if((pl.weapons & WepSet_FromWeapon(i)) || (weaponsInMap & WepSet_FromWeapon(i))) - have_other = TRUE; + have_other = true; } // skip weapons we don't own that aren't normal and aren't in the map @@ -153,7 +153,7 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa ++c; - if(!skipmissing || client_hasweapon(pl, weaponwant, TRUE, FALSE)) + if(!skipmissing || client_hasweapon(pl, weaponwant, true, false)) { if(switchtonext) return weaponwant; @@ -182,7 +182,7 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa if(complain) { self.weaponcomplainindex += 1; - c = mod(self.weaponcomplainindex, c) + 1; + c = (self.weaponcomplainindex % c) + 1; rest = weaponorder; while(rest != "") { @@ -193,13 +193,13 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa if(wep.impulse != imp) continue; - float i, have_other = FALSE; + float i, have_other = false; for(i = WEP_FIRST; i <= WEP_LAST; ++i) { if(i != weaponwant) if((get_weaponinfo(i)).impulse == imp || imp < 0) if((pl.weapons & WepSet_FromWeapon(i)) || (weaponsInMap & WepSet_FromWeapon(i))) - have_other = TRUE; + have_other = true; } // skip weapons we don't own that aren't normal and aren't in the map @@ -211,7 +211,7 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa --c; if(c == 0) { - client_hasweapon(pl, weaponwant, TRUE, TRUE); + client_hasweapon(pl, weaponwant, true, true); break; } } @@ -248,7 +248,7 @@ void W_SwitchWeapon(float imp) { if (self.switchweapon != imp) { - if (client_hasweapon(self, imp, TRUE, TRUE)) + if (client_hasweapon(self, imp, true, true)) W_SwitchWeapon_Force(self, imp); else self.selectweapon = imp; // update selectweapon ANYWAY @@ -259,7 +259,7 @@ void W_SwitchWeapon(float imp) void W_CycleWeapon(string weaponorder, float dir) { float w; - w = W_GetCycleWeapon(self, weaponorder, dir, -1, 1, TRUE); + w = W_GetCycleWeapon(self, weaponorder, dir, -1, 1, true); if(w > 0) W_SwitchWeapon(w); } @@ -297,7 +297,7 @@ void W_PreviousWeapon(float list) // previously used if exists and has ammo, (second) best otherwise void W_LastWeapon(void) { - if(client_hasweapon(self, self.cnt, TRUE, FALSE)) + if(client_hasweapon(self, self.cnt, true, false)) W_SwitchWeapon(self.cnt); else W_SwitchToOtherWeapon(self);