Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
sv_breakablehook.qc File Reference
Include dependency graph for sv_breakablehook.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 MUTATOR_HOOKFUNCTION (breakablehook, Damage_Calculate)
 REGISTER_MUTATOR (breakablehook, cvar("g_breakablehook"))

Variables

bool autocvar_g_breakablehook
bool autocvar_g_breakablehook_owner

Function Documentation

◆ MUTATOR_HOOKFUNCTION()

MUTATOR_HOOKFUNCTION ( breakablehook ,
Damage_Calculate  )

Definition at line 11 of file sv_breakablehook.qc.

12{
13 entity frag_attacker = M_ARGV(1, entity);
15
16 if(frag_target.classname == "grapplinghook")
17 {
19 || (!autocvar_g_breakablehook_owner && frag_attacker == frag_target.realowner)
20 ) { M_ARGV(4, float) = 0; }
21
22 // hurt the owner of the hook
23 if(DIFF_TEAM(frag_attacker, frag_target.realowner))
24 {
25 Damage (frag_target.realowner, frag_attacker, frag_attacker, 5, WEP_HOOK.m_id | HITTYPE_SPLASH, DMG_NOWEP, frag_target.realowner.origin, '0 0 0'); // TODO: should get weapon entity from mutator hook
27 return; // dead
28 }
29 }
30}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
#define M_ARGV(x, type)
Definition events.qh:17
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
Definition damage.qc:503
#define DMG_NOWEP
Definition damage.qh:104
const int HITTYPE_SPLASH
Definition all.qh:30
void RemoveHook(entity this)
Definition hook.qc:48
bool autocvar_g_breakablehook_owner
bool autocvar_g_breakablehook
entity frag_target
Definition sv_ctf.qc:2321
#define DIFF_TEAM(a, b)
Definition teams.qh:242

References autocvar_g_breakablehook, autocvar_g_breakablehook_owner, Damage(), DIFF_TEAM, DMG_NOWEP, entity(), frag_target, HITTYPE_SPLASH, M_ARGV, and RemoveHook().

◆ REGISTER_MUTATOR()

REGISTER_MUTATOR ( breakablehook ,
cvar("g_breakablehook")  )

Variable Documentation

◆ autocvar_g_breakablehook

bool autocvar_g_breakablehook

Definition at line 8 of file sv_breakablehook.qc.

Referenced by MUTATOR_HOOKFUNCTION().

◆ autocvar_g_breakablehook_owner

bool autocvar_g_breakablehook_owner

Definition at line 9 of file sv_breakablehook.qc.

Referenced by MUTATOR_HOOKFUNCTION().