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.
This commit is contained in:
Yamagi 2022-02-05 16:59:10 +01:00
parent 9d827b13da
commit a0cd32dddb
2 changed files with 2 additions and 7 deletions

View file

@ -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;
}

View file

@ -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);