thirtyflightsofloving/missionpack/g_newutils.c
Knightmare66 f829090864 Added custom animations array and enabled target_animation entity in missionpack DLL.
Added support for custom client railgun colors in missionpack DLL.
Removed sk_rail_color_* cvars from missionpack DLL.
Added CS_HUDVARIANT configstring.
Added code to set CS_HUDVARIANT configstring in game DLLs.
2021-11-11 21:32:00 -05:00

40 lines
830 B
C

#include "g_local.h"
/*
===================================================
Check we have a valid target.
Should be set as a think function with
nextthink level.time+1 after spawning.
Sets self->think to NULL, so if you want
another think function after it you'll
need this check in the code
===================================================
*/
void VerifyTarget (edict_t *self)
{
edict_t *ent;
if(self->target)
{
ent = G_Find (NULL, FOFS(targetname), self->target);
if (!ent)
{
gi.dprintf ("%s at %s: %s is a bad target\n", self->classname, vtos(self->s.origin), self->target);
G_FreeEdict (self);
return;
}
self->enemy = ent;
}
else
{
gi.dprintf("target_set_effect at %s has no target\n", vtos(self->s.origin));
G_FreeEdict (self);
return;
}
self->think = NULL;
self->nextthink = 0;
}