#include "weapons/tracing.qh"
#include "weapons/weaponsystem.qh"
+#include <common/gamemodes/_mod.qh>
+
#include <common/state.qh>
#include "../common/minigames/sv_minigames.qh"
// weapon switching impulses
-#define X(slot) \
- IMPULSE(weapon_group_##slot) \
+#define X(i) \
+ IMPULSE(weapon_group_##i) \
{ \
if (IS_DEAD(this)) \
{ \
- this.impulse = IMP_weapon_group_##slot.impulse; \
+ this.impulse = IMP_weapon_group_##i.impulse; \
return; \
} \
- for(int wepslot = 0; wepslot < MAX_WEAPONSLOTS; ++wepslot) \
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) \
{ \
- .entity weaponentity = weaponentities[wepslot]; \
- W_NextWeaponOnImpulse(this, slot, weaponentity); \
+ .entity weaponentity = weaponentities[slot]; \
+ W_NextWeaponOnImpulse(this, i, weaponentity); \
if(autocvar_g_weaponswitch_debug != 1) \
break; \
} \
// custom order weapon cycling
-#define X(slot, dir) \
- IMPULSE(weapon_priority_##slot##_##dir) \
+#define X(i, dir) \
+ IMPULSE(weapon_priority_##i##_##dir) \
{ \
if (this.vehicle) return; \
if (IS_DEAD(this)) \
{ \
- this.impulse = IMP_weapon_priority_##slot##_##dir.impulse; \
+ this.impulse = IMP_weapon_priority_##i##_##dir.impulse; \
return; \
} \
noref int prev = -1; \
noref int best = 0; \
noref int next = +1; \
- for(int wepslot = 0; wepslot < MAX_WEAPONSLOTS; ++wepslot) \
+ for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) \
{ \
- .entity weaponentity = weaponentities[wepslot]; \
- W_CycleWeapon(this, CS(this).cvar_cl_weaponpriorities[slot], dir, weaponentity); \
+ .entity weaponentity = weaponentities[slot]; \
+ W_CycleWeapon(this, CS(this).cvar_cl_weaponpriorities[i], dir, weaponentity); \
if(autocvar_g_weaponswitch_debug != 1) \
break; \
} \
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) \
{ \
.entity weaponentity = weaponentities[slot]; \
- W_SwitchWeapon_TryOthers(this, Weapons_from(WEP_FIRST + i), weaponentity); \
+ W_SwitchWeapon_TryOthers(this, REGISTRY_GET(Weapons, WEP_FIRST + i), weaponentity); \
if(autocvar_g_weaponswitch_debug != 1) \
break; \
} \
{
if (this.vehicle) return;
if (IS_DEAD(this)) return;
- if (forbidWeaponUse(this)) return;
+ if (weaponLocked(this)) return;
entity actor = this;
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
IMPULSE(waypoint_here_crosshair)
{
- WarpZone_crosshair_trace(this);
+ WarpZone_crosshair_trace_plusvisibletriggers(this);
entity wp = WaypointSprite_DeployFixed(WP_Here, false, this, trace_endpos, RADARICON_HERE);
if (wp) WaypointSprite_Ping(wp);
sprint(this, "HERE spawned at crosshair\n");