From a0cd32dddb74176ff70fd3bb1e66dc8f981357a5 Mon Sep 17 00:00:00 2001 From: Yamagi Date: Sat, 5 Feb 2022 16:59:10 +0100 Subject: [PATCH] Fix door_go_up(), G_UseTargets() exiting early if no activator is given. The problem in door_go_up() may prevent doors from crushing something blocking them. The problem in G_UseTargets() may prevent targets from getting killed or fired. Pointed out by @maraakate. --- src/game/g_func.c | 2 +- src/game/g_utils.c | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/game/g_func.c b/src/game/g_func.c index 334960d8..c270a21e 100644 --- a/src/game/g_func.c +++ b/src/game/g_func.c @@ -1378,7 +1378,7 @@ door_go_down(edict_t *self) void door_go_up(edict_t *self, edict_t *activator) { - if (!self || !activator) + if (!self) { return; } diff --git a/src/game/g_utils.c b/src/game/g_utils.c index 7a80210e..fa7e9453 100644 --- a/src/game/g_utils.c +++ b/src/game/g_utils.c @@ -242,13 +242,8 @@ G_UseTargets(edict_t *ent, edict_t *activator) return; } - if (!activator) - { - return; - } - /* print the message */ - if ((ent->message) && !(activator->svflags & SVF_MONSTER)) + if (activator && (ent->message) && !(activator->svflags & SVF_MONSTER)) { gi.centerprintf(activator, "%s", ent->message);