From 78de36c25ae47b7ee741477e696cbc3e5d63cc2f Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sat, 17 Dec 2016 09:43:58 +0100 Subject: [PATCH] Fix sanity checks of train_blocked() and train_use() With the changes the sanity checks are the same as in baseq2 and xatrix. Reported by maraakate in yquake2 issue #160. --- src/g_func.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/g_func.c b/src/g_func.c index 42e24c7..ede92d8 100644 --- a/src/g_func.c +++ b/src/g_func.c @@ -3032,6 +3032,11 @@ SP_func_water(edict_t *self) void train_blocked(edict_t *self, edict_t *other) { + if (!self || !other) + { + return; + } + if (!(other->svflags & SVF_MONSTER) && (!other->client)) { /* give it a chance to go away on it's own terms (like gibs) */ @@ -3316,7 +3321,7 @@ void train_use(edict_t *self, edict_t *other /* unused */, edict_t *activator) { - if (!self || !other) + if (!self || !activator) { return; }