X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_hook.qc;h=aa970f4be3626a6ef4187417ad8c6f4a3f84769a;hb=c1c5a398025611690a8d7d6bd64219ccf452e673;hp=453cfc1e70d3664d1725e795c685c36c1e00cb69;hpb=45d8904a100765555e622598a39967963733df1d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 453cfc1e7..aa970f4be 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -21,8 +21,6 @@ #include "../lib/warpzone/common.qh" #include "../lib/warpzone/server.qh" -.int state; - /*============================================ Wazat's Xonotic Grappling Hook @@ -72,8 +70,6 @@ And you should be done! ============================================*/ -.float hook_length; - void RemoveGrapplingHooks(entity pl) { if(pl.move_movetype == MOVETYPE_FLY) @@ -363,9 +359,13 @@ void FireGrapplingHook(entity actor, .entity weaponentity) if(weaponLocked(actor)) return; if(actor.vehicle) return; - // TODO: offhand hook shoots from eye + int s = W_GunAlign(actor.(weaponentity), STAT(GUNALIGN, actor)) - 1; + vector vs = hook_shotorigin[s]; + vector oldmovedir = actor.(weaponentity).movedir; + actor.(weaponentity).movedir = vs; W_SetupShot_ProjectileSize(actor, weaponentity, '-3 -3 -3', '3 3 3', true, 0, SND_HOOK_FIRE, CH_WEAPON_B, 0, WEP_HOOK.m_id); Send_Effect(EFFECT_HOOK_MUZZLEFLASH, w_shotorg, '0 0 0', 1); + actor.(weaponentity).movedir = oldmovedir; entity missile = WarpZone_RefSys_SpawnSameRefSys(actor); missile.owner = missile.realowner = actor;