From 4c654363424038cb068874df11572d0c945b7298 Mon Sep 17 00:00:00 2001 From: Yamagi Date: Sat, 5 Feb 2022 17:18:27 +0100 Subject: [PATCH] Fix door_go_up() exiting early. The problem in door_go_up() may prevent doors from crushing something blocking them. While add it sanity check `activator` in `G_UseTargets()`. --- src/g_func.c | 2 +- src/g_utils.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_func.c b/src/g_func.c index 568e556..7c3cbe8 100644 --- a/src/g_func.c +++ b/src/g_func.c @@ -1350,7 +1350,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/g_utils.c b/src/g_utils.c index 105de55..d94b2d0 100644 --- a/src/g_utils.c +++ b/src/g_utils.c @@ -210,7 +210,7 @@ G_UseTargets(edict_t *ent, edict_t *activator /* may be NULL */) } /* print the message */ - if ((ent->message) && !(activator->svflags & SVF_MONSTER)) + if (activator && (ent->message) && !(activator->svflags & SVF_MONSTER)) { gi.centerprintf(activator, "%s", ent->message);