X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fweapons%2Fselection.qc;h=17fd9e0e0ab59ff19d53fbd642b9e954cb44ff87;hb=258867c634125e1d048869b4a5d8ef279e8b8228;hp=f1866eab089311a0ce2c2a052d6b9b3fbaf00031;hpb=6c319c2baf6bcac5d7f57d097b7773d1f6f23294;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index f1866eab0..17fd9e0e0 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -1,14 +1,15 @@ #include "selection.qh" #include "weaponsystem.qh" -#include -#include +#include +#include #include #include #include #include #include #include +#include #include #include @@ -151,7 +152,7 @@ float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, fl while(rest != "") { weaponwant = stof(car(rest)); rest = cdr(rest); - wep = Weapons_from(weaponwant); + wep = REGISTRY_GET(Weapons, weaponwant); wepset = wep.m_wepset; if(imp >= 0) if(wep.impulse != imp) @@ -207,7 +208,7 @@ float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, fl while(rest != "") { weaponwant = stof(car(rest)); rest = cdr(rest); - wep = Weapons_from(weaponwant); + wep = REGISTRY_GET(Weapons, weaponwant); wepset = wep.m_wepset; if(imp >= 0) if(wep.impulse != imp) @@ -301,7 +302,7 @@ void W_CycleWeapon(entity this, string weaponorder, float dir, .entity weaponent float w; w = W_GetCycleWeapon(this, weaponorder, dir, -1, 1, true, weaponentity); if(w > 0) - W_SwitchWeapon(this, Weapons_from(w), weaponentity); + W_SwitchWeapon(this, REGISTRY_GET(Weapons, w), weaponentity); } void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity) @@ -309,7 +310,7 @@ void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity) float w; w = W_GetCycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, imp, 1, (CS(this).cvar_cl_weaponimpulsemode == 0), weaponentity); if(w > 0) - W_SwitchWeapon(this, Weapons_from(w), weaponentity); + W_SwitchWeapon(this, REGISTRY_GET(Weapons, w), weaponentity); } // next weapon @@ -337,7 +338,7 @@ void W_PreviousWeapon(entity this, float list, .entity weaponentity) // previously used if exists and has ammo, (second) best otherwise void W_LastWeapon(entity this, .entity weaponentity) { - Weapon wep = Weapons_from(this.(weaponentity).cnt); + Weapon wep = REGISTRY_GET(Weapons, this.(weaponentity).cnt); if (client_hasweapon(this, wep, weaponentity, true, false)) W_SwitchWeapon(this, wep, weaponentity); else