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.
This commit is contained in:
Yamagi Burmeister 2016-12-17 09:43:58 +01:00
parent d5fbc8c0f1
commit 78de36c25a

View file

@ -3032,6 +3032,11 @@ SP_func_water(edict_t *self)
void void
train_blocked(edict_t *self, edict_t *other) train_blocked(edict_t *self, edict_t *other)
{ {
if (!self || !other)
{
return;
}
if (!(other->svflags & SVF_MONSTER) && (!other->client)) if (!(other->svflags & SVF_MONSTER) && (!other->client))
{ {
/* give it a chance to go away on it's own terms (like gibs) */ /* 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 */, train_use(edict_t *self, edict_t *other /* unused */,
edict_t *activator) edict_t *activator)
{ {
if (!self || !other) if (!self || !activator)
{ {
return; return;
} }