]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/hook.qc
Remove legacy Quake bbox expansion: projectiles
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / hook.qc
index 6042a48e1a61edae4c6bd572d3564f051e959017..5bc00c1506a4e202fe4891d12e1aeac021c34fc1 100644 (file)
@@ -1,29 +1,30 @@
 #include "hook.qh"
 
-#include <server/bot/api.qh>
-#include <common/weapons/_all.qh>
-#include <common/stats.qh>
-#include <server/damage.qh>
-#include <server/miscfunctions.qh>
+#include <common/constants.qh>
 #include <common/effects/all.qh>
-#include "weapons/common.qh"
-#include "weapons/csqcprojectile.qh"
-#include "weapons/weaponsystem.qh"
-#include "weapons/selection.qh"
-#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"
-#include "../common/vehicles/all.qh"
-#include "../common/constants.qh"
-#include "../common/util.qh"
 #include <common/net_linked.qh>
+#include <common/physics/player.qh>
+#include <common/state.qh>
+#include <common/stats.qh>
+#include <common/util.qh>
+#include <common/vehicles/all.qh>
+#include <common/weapons/_all.qh>
 #include <common/weapons/_all.qh>
-#include "../lib/warpzone/common.qh"
-#include "../lib/warpzone/server.qh"
+#include <lib/warpzone/common.qh>
+#include <lib/warpzone/server.qh>
+#include <server/bot/api.qh>
+#include <server/command/common.qh>
+#include <server/command/vote.qh>
+#include <server/damage.qh>
+#include <server/mutators/_mod.qh>
+#include <server/player.qh>
+#include <server/round_handler.qh>
+#include <server/weapons/common.qh>
+#include <server/weapons/csqcprojectile.qh>
+#include <server/weapons/selection.qh>
+#include <server/weapons/tracing.qh>
+#include <server/weapons/weaponsystem.qh>
+#include <server/world.qh>
 
 /*============================================
 
@@ -160,7 +161,9 @@ void GrapplingHookThink(entity this)
                error("Owner lost the hook!\n");
                return;
        }
-       if(LostMovetypeFollow(this) || game_stopped || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade"))
+       if((this.move_movetype == MOVETYPE_FOLLOW && LostMovetypeFollow(this))
+               || game_stopped || (round_handler_IsActive() && !round_handler_IsRoundStarted())
+               || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade"))
        {
                RemoveHook(this);
                return;
@@ -367,7 +370,7 @@ void FireGrapplingHook(entity actor, .entity weaponentity)
        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);
+       W_SetupShot_ProjectileSize(actor, weaponentity, HOOK_MINS, HOOK_MAXS, true, 0, SND_HOOK_FIRE, CH_WEAPON_B, 0, WEP_HOOK.m_id);
        W_MuzzleFlash(WEP_HOOK, actor, weaponentity, w_shotorg, '0 0 0');
        actor.(weaponentity).movedir = oldmovedir;
 
@@ -385,7 +388,7 @@ void FireGrapplingHook(entity actor, .entity weaponentity)
        PROJECTILE_MAKETRIGGER(missile);
 
        //setmodel (missile, MDL_HOOK); // precision set below
-       setsize (missile, '-3 -3 -3', '3 3 3');
+       setsize (missile, HOOK_MINS, HOOK_MAXS);
        setorigin(missile, w_shotorg);
 
        missile.state = 0; // not latched onto anything
@@ -414,7 +417,8 @@ void FireGrapplingHook(entity actor, .entity weaponentity)
        Net_LinkEntity(missile, false, 0, GrapplingHookSend);
 }
 
-void GrappleHookInit()
+// NOTE: using PRECACHE here to make sure it's called after everything else
+PRECACHE(GrappleHookInit)
 {
        if(g_grappling_hook)
        {