Skip to content

Instantly share code, notes, and snippets.

@technoweenie
Created October 21, 2008 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save technoweenie/18277 to your computer and use it in GitHub Desktop.
Save technoweenie/18277 to your computer and use it in GitHub Desktop.
/*
=============
ai_walk
The monster is walking it's beat
=============
*/
void ai_walk (edict_t *self, float dist)
{
M_MoveToGoal (self, dist);
// check for noticing a player
if (FindTarget (self))
return;
if ((self->monsterinfo.search) && (level.time > self->monsterinfo.idle_time))
{
if (self->monsterinfo.idle_time)
{
self->monsterinfo.search (self);
self->monsterinfo.idle_time = level.time + 15 + random() * 15;
}
else
{
self->monsterinfo.idle_time = level.time + random() * 15;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment