Reversing Actor Final Part

This commit is contained in:
mohabhassan 2018-09-05 16:55:10 +02:00
parent cb239c3c7f
commit 6528ba4dac
40 changed files with 3983 additions and 779 deletions

View file

@ -464,23 +464,52 @@ SimpleEntity *G_FindTarget( SimpleEntity *ent, const char *name )
SimpleEntity *G_FindRandomSimpleTarget( const char *name )
{
SimpleEntity *found = NULL, *ent = NULL;
SimpleEntity *found = NULL, *ent = world;
int nFound = 0;
if (name && *name)
{
while (1)
while (true)
{
ent = world->GetNextEntity(name, ent);
if (!ent)
{
break;
}
rand();
found = ent;
if (++nFound * rand() <= 0x7FFF)
{
found = ent;
}
}
}
return found;
}
Entity *G_FindRandomTarget( const char *name )
{
SimpleEntity *found = NULL, *ent = world;
int nFound = 0;
if (name && *name)
{
while (true)
{
ent = world->GetNextEntity(name, ent);
if (!ent)
{
break;
}
if (ent->IsSubclassOfEntity() && ++nFound * rand() <= 0x7FFF)
{
found = ent;
}
}
}
return (Entity *)found;
}
void G_TouchTriggers( Entity *ent )
{
int i;