- Added handling for UDMF user keys.
- Added support for ACS functions that can be defined without recompiling ACC. - Fixed: The short lump name for embedded files must be cleared so that they are not found by a normal lump search. - Added AProp_Notarget actor property. - Fixed: TraceBleed was missing a NULL pointer check, - Fixed: P_RandomChaseDir could crash for friendly monsters that belong to a player which left the game. - Changed A_PodGrow so that it plays the generator's attack sound instead of "misc/podgrow". SVN r1575 (trunk)
This commit is contained in:
parent
b224765351
commit
571d28281b
16 changed files with 540 additions and 1493 deletions
|
|
@ -846,60 +846,62 @@ void P_RandomChaseDir (AActor *actor)
|
|||
}
|
||||
player = players[i].mo;
|
||||
}
|
||||
|
||||
if (pr_newchasedir() & 1 || !P_CheckSight (actor, player))
|
||||
if (player != NULL && playeringame[i])
|
||||
{
|
||||
deltax = player->x - actor->x;
|
||||
deltay = player->y - actor->y;
|
||||
|
||||
if (deltax>128*FRACUNIT)
|
||||
d[1]= DI_EAST;
|
||||
else if (deltax<-128*FRACUNIT)
|
||||
d[1]= DI_WEST;
|
||||
else
|
||||
d[1]=DI_NODIR;
|
||||
|
||||
if (deltay<-128*FRACUNIT)
|
||||
d[2]= DI_SOUTH;
|
||||
else if (deltay>128*FRACUNIT)
|
||||
d[2]= DI_NORTH;
|
||||
else
|
||||
d[2]=DI_NODIR;
|
||||
|
||||
// try direct route
|
||||
if (d[1] != DI_NODIR && d[2] != DI_NODIR)
|
||||
if (pr_newchasedir() & 1 || !P_CheckSight (actor, player))
|
||||
{
|
||||
actor->movedir = diags[((deltay<0)<<1) + (deltax>0)];
|
||||
if (actor->movedir != turnaround && P_TryWalk(actor))
|
||||
return;
|
||||
}
|
||||
deltax = player->x - actor->x;
|
||||
deltay = player->y - actor->y;
|
||||
|
||||
// try other directions
|
||||
if (pr_newchasedir() > 200 || abs(deltay) > abs(deltax))
|
||||
{
|
||||
swap (d[1], d[2]);
|
||||
}
|
||||
if (deltax>128*FRACUNIT)
|
||||
d[1]= DI_EAST;
|
||||
else if (deltax<-128*FRACUNIT)
|
||||
d[1]= DI_WEST;
|
||||
else
|
||||
d[1]=DI_NODIR;
|
||||
|
||||
if (d[1] == turnaround)
|
||||
d[1] = DI_NODIR;
|
||||
if (d[2] == turnaround)
|
||||
d[2] = DI_NODIR;
|
||||
|
||||
if (d[1] != DI_NODIR)
|
||||
{
|
||||
actor->movedir = d[1];
|
||||
if (P_TryWalk (actor))
|
||||
if (deltay<-128*FRACUNIT)
|
||||
d[2]= DI_SOUTH;
|
||||
else if (deltay>128*FRACUNIT)
|
||||
d[2]= DI_NORTH;
|
||||
else
|
||||
d[2]=DI_NODIR;
|
||||
|
||||
// try direct route
|
||||
if (d[1] != DI_NODIR && d[2] != DI_NODIR)
|
||||
{
|
||||
// either moved forward or attacked
|
||||
return;
|
||||
actor->movedir = diags[((deltay<0)<<1) + (deltax>0)];
|
||||
if (actor->movedir != turnaround && P_TryWalk(actor))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (d[2] != DI_NODIR)
|
||||
{
|
||||
actor->movedir = d[2];
|
||||
if (P_TryWalk (actor))
|
||||
return;
|
||||
// try other directions
|
||||
if (pr_newchasedir() > 200 || abs(deltay) > abs(deltax))
|
||||
{
|
||||
swap (d[1], d[2]);
|
||||
}
|
||||
|
||||
if (d[1] == turnaround)
|
||||
d[1] = DI_NODIR;
|
||||
if (d[2] == turnaround)
|
||||
d[2] = DI_NODIR;
|
||||
|
||||
if (d[1] != DI_NODIR)
|
||||
{
|
||||
actor->movedir = d[1];
|
||||
if (P_TryWalk (actor))
|
||||
{
|
||||
// either moved forward or attacked
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (d[2] != DI_NODIR)
|
||||
{
|
||||
actor->movedir = d[2];
|
||||
if (P_TryWalk (actor))
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue