X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon%2Fhook.qc;h=e04376b2f4fee279a289c1bb7bb8fcb4de320e36;hb=9e8ea75b9aacffc5cfa18c8852c4dd9ffdbd3192;hp=d92e0caa8538b4c9ec4ccc5c0bc79a3fef41e7f4;hpb=04692f3bf447ec38a1bbb0a330c288bbe7a42726;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index d92e0caa8..e04376b2f 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -2,8 +2,6 @@ #ifdef SVQC -spawnfunc(weapon_hook) { weapon_defaultspawnfunc(this, WEP_HOOK); } - void W_Hook_ExplodeThink(entity this) { float dt, dmg_remaining_next, f; @@ -14,7 +12,7 @@ void W_Hook_ExplodeThink(entity this) f = this.dmg_last - dmg_remaining_next; this.dmg_last = dmg_remaining_next; - RadiusDamage(this, this.realowner, this.dmg * f, this.dmg_edge * f, this.dmg_radius, this.realowner, NULL, this.dmg_force * f, this.projectiledeathtype, NULL); + RadiusDamage(this, this.realowner, this.dmg * f, this.dmg_edge * f, this.dmg_radius, this.realowner, NULL, this.dmg_force * f, this.projectiledeathtype, this.weaponentity_fld, NULL); this.projectiledeathtype |= HITTYPE_BOUNCE; //RadiusDamage(this, NULL, this.dmg * f, this.dmg_edge * f, this.dmg_radius, NULL, NULL, this.dmg_force * f, this.projectiledeathtype, NULL); @@ -48,7 +46,7 @@ void W_Hook_Explode2_use(entity this, entity actor, entity trigger) W_Hook_Explode2(this); } -void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) +void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, .entity weaponentity, vector hitloc, vector force) { if(this.health <= 0) return; @@ -71,7 +69,7 @@ void W_Hook_Touch2(entity this, entity toucher) void W_Hook_Attack2(Weapon thiswep, entity actor, .entity weaponentity) { //W_DecreaseAmmo(thiswep, actor, WEP_CVAR_SEC(hook, ammo)); // WEAPONTODO: Figure out how to handle ammo with hook secondary (gravitybomb) - W_SetupShot(actor, weaponentity, false, 4, SND_HOOKBOMB_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hook, damage)); + W_SetupShot(actor, weaponentity, false, 4, SND_HOOKBOMB_FIRE, CH_WEAPON_A, WEP_CVAR_SEC(hook, damage), WEP_HOOK.m_id | HITTYPE_SECONDARY); entity gren = new(hookbomb); gren.owner = gren.realowner = actor; @@ -80,6 +78,7 @@ void W_Hook_Attack2(Weapon thiswep, entity actor, .entity weaponentity) set_movetype(gren, MOVETYPE_TOSS); PROJECTILE_MAKETRIGGER(gren); gren.projectiledeathtype = WEP_HOOK.m_id | HITTYPE_SECONDARY; + gren.weaponentity_fld = weaponentity; setorigin(gren, w_shotorg); setsize(gren, '0 0 0', '0 0 0'); @@ -320,8 +319,8 @@ void Draw_GrapplingHook(entity this) { default: case NET_ENT_CLIENT_HOOK: - if(autocvar_chase_active > 0) - a = csqcplayer.origin; + if(autocvar_chase_active) + a = csqcplayer.origin + csqcplayer.view_ofs; else a = view_origin + view_forward * vs.x + view_right * -vs.y + view_up * vs.z; b = this.origin;