From 2414ee3c816191b6c88e076d8a9cbdc233e4dc2b Mon Sep 17 00:00:00 2001 From: Yimura Date: Sat, 8 Jan 2022 14:09:00 +0100 Subject: [PATCH] fix(CustomWeapons): Fix Gravity Gun not doing cleanup when failing REQUEST_CONTROL Fixes #40 --- BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp b/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp index 647ec789..98a04bd6 100644 --- a/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp +++ b/BigBaseV2/src/backend/looped/weapons/gravity_gun.cpp @@ -76,7 +76,12 @@ namespace big if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 15)) dist += 5; - if (!entity::take_control_of(ent)) return; + if (!entity::take_control_of(ent)) + { + ent = 0; + + return notify::above_map("Failed to take control of entity."); + } ENTITY::SET_ENTITY_COLLISION(ent, false, false);