]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_hook.qc
Don't attempt to network more than the maximum number of shown spectators, fixes...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_hook.qc
index b2b91bc02baf71cea1adf089e8236eea2a397667..57947200a6b819cdf3653af6a7027d00259b2783 100644 (file)
@@ -1,6 +1,9 @@
 #include "g_hook.qh"
 
-#include <server/defs.qh>
+#include <server/bot/api.qh>
+#include <common/weapons/_all.qh>
+#include <common/stats.qh>
+#include <server/g_damage.qh>
 #include <server/miscfunctions.qh>
 #include <common/effects/all.qh>
 #include "weapons/common.qh"
@@ -10,6 +13,7 @@
 #include "weapons/tracing.qh"
 #include "player.qh"
 #include "command/common.qh"
+#include "command/vote.qh"
 #include "round_handler.qh"
 #include "../common/state.qh"
 #include "../common/physics/player.qh"
@@ -359,9 +363,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);
+       W_MuzzleFlash(WEP_HOOK, actor, weaponentity, w_shotorg, '0 0 0');
+       actor.(weaponentity).movedir = oldmovedir;
 
        entity missile = WarpZone_RefSys_SpawnSameRefSys(actor);
        missile.owner = missile.realowner = actor;