X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_hook.qc;h=36e1e4e52ba2458cab620ac962d1b9af6fc634ae;hb=64f2b309aa5be8aafb9ad2137174bb6d99aeb876;hp=636e8c6aae99670ab355a0c24354c4a4c79291f3;hpb=f23e93047012043fe9c7c3bf533546c364b18bde;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 636e8c6aa..36e1e4e52 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -13,6 +13,7 @@ #include "../common/vehicles/all.qh" #include "../common/constants.qh" #include "../common/util.qh" +#include #include #include "../lib/warpzone/common.qh" #include "../lib/warpzone/server.qh" @@ -172,7 +173,7 @@ void GrapplingHookThink(entity this) this.nextthink = time; - int s = W_GunAlign(this.realowner.(weaponentity), STAT(GUNALIGN, this.realowner)); + int s = W_GunAlign(this.realowner.(weaponentity), STAT(GUNALIGN, this.realowner)) - 1; vs = hook_shotorigin[s]; makevectors(this.realowner.v_angle); @@ -362,28 +363,24 @@ void GrapplingHook_Damage(entity this, entity inflictor, entity attacker, float void FireGrapplingHook(entity actor, .entity weaponentity) { - entity missile; - vector org; - vector vs; - if(forbidWeaponUse(actor)) return; if(actor.vehicle) return; makevectors(actor.v_angle); - int s = W_GunAlign(actor.(weaponentity), STAT(GUNALIGN, actor)); - vs = hook_shotorigin[s]; + int s = W_GunAlign(actor.(weaponentity), STAT(GUNALIGN, actor)) - 1; + vector vs = hook_shotorigin[s]; // UGLY WORKAROUND: play this on CH_WEAPON_B so it can't cut off fire sounds sound (actor, CH_WEAPON_B, SND_HOOK_FIRE, VOL_BASE, ATTEN_NORM); - org = actor.origin + actor.view_ofs + v_forward * vs.x + v_right * -vs.y + v_up * vs.z; + vector org = actor.origin + actor.view_ofs + v_forward * vs.x + v_right * -vs.y + v_up * vs.z; tracebox(actor.origin + actor.view_ofs, '-3 -3 -3', '3 3 3', org, MOVE_NORMAL, actor); org = trace_endpos; Send_Effect(EFFECT_HOOK_MUZZLEFLASH, org, '0 0 0', 1); - missile = WarpZone_RefSys_SpawnSameRefSys(actor); + entity missile = WarpZone_RefSys_SpawnSameRefSys(actor); missile.owner = missile.realowner = actor; actor.(weaponentity).hook = missile; missile.weaponentity_fld = weaponentity; @@ -418,6 +415,8 @@ void FireGrapplingHook(entity actor, .entity weaponentity) missile.takedamage = DAMAGE_AIM; missile.damageforcescale = 0; missile.damagedbycontents = (autocvar_g_balance_grapplehook_damagedbycontents); + if(missile.damagedbycontents) + IL_PUSH(g_damagedbycontents, missile); missile.hook_start = missile.hook_end = missile.origin;