- If A_SeekerMissile is used with the SMF_LOOK flag and its targets is unseekable, it now clears
its tracer so that it will look for a new target the next time it is called. - Extended P_RoughMonsterSearch() with a flag to indicate that it should only search for seekable targets. SVN r3572 (trunk)
This commit is contained in:
parent
86842bc1da
commit
5b86ce9f7d
5 changed files with 19 additions and 8 deletions
|
|
@ -1401,9 +1401,9 @@ FPathTraverse::~FPathTraverse()
|
|||
// distance is in MAPBLOCKUNITS
|
||||
//===========================================================================
|
||||
|
||||
AActor *P_RoughMonsterSearch (AActor *mo, int distance)
|
||||
AActor *P_RoughMonsterSearch (AActor *mo, int distance, bool onlyseekable)
|
||||
{
|
||||
return P_BlockmapSearch (mo, distance, RoughBlockCheck);
|
||||
return P_BlockmapSearch (mo, distance, RoughBlockCheck, (void *)onlyseekable);
|
||||
}
|
||||
|
||||
AActor *P_BlockmapSearch (AActor *mo, int distance, AActor *(*check)(AActor*, int, void *), void *params)
|
||||
|
|
@ -1501,14 +1501,19 @@ AActor *P_BlockmapSearch (AActor *mo, int distance, AActor *(*check)(AActor*, in
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
static AActor *RoughBlockCheck (AActor *mo, int index, void *)
|
||||
static AActor *RoughBlockCheck (AActor *mo, int index, void *param)
|
||||
{
|
||||
bool onlyseekable = param != NULL;
|
||||
FBlockNode *link;
|
||||
|
||||
for (link = blocklinks[index]; link != NULL; link = link->NextActor)
|
||||
{
|
||||
if (link->Me != mo)
|
||||
{
|
||||
if (onlyseekable && !mo->CanSeek(link->Me))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (mo->IsOkayToAttack (link->Me))
|
||||
{
|
||||
return link->Me;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue