From 79dbe32e742d81b8b77e35d23a1a0d5df41b4b68 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 15 Jun 2018 23:40:29 +1000 Subject: [PATCH] Attach the hook properly to entities even if they have the NONE movetype, and remove attached hooks when func_breakable is destroyed --- qcsrc/common/mapobjects/func/breakable.qc | 5 +++++ qcsrc/server/g_hook.qc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/mapobjects/func/breakable.qc b/qcsrc/common/mapobjects/func/breakable.qc index d8f6cb138..2b4d5f232 100644 --- a/qcsrc/common/mapobjects/func/breakable.qc +++ b/qcsrc/common/mapobjects/func/breakable.qc @@ -141,6 +141,11 @@ void func_breakable_behave_destroyed(entity this) func_breakable_colormod(this); if (this.noise1) stopsound (this, CH_TRIGGER_SINGLE); + + IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this, + { + RemoveHook(it); + }); } void func_breakable_think(entity this) diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 09135d482..b9e95c623 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -327,7 +327,7 @@ void GrapplingHookTouch(entity this, entity toucher) GrapplingHook_Stop(this); if(toucher) - if(toucher.move_movetype != MOVETYPE_NONE) + //if(toucher.move_movetype != MOVETYPE_NONE) { SetMovetypeFollow(this, toucher); WarpZone_RefSys_BeginAddingIncrementally(this, this.aiment); -- 2.39.2