mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-11 04:56:41 +03:00
Reversing Actor Final Part
This commit is contained in:
parent
cb239c3c7f
commit
6528ba4dac
40 changed files with 3983 additions and 779 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue