- Fixed: AMageStaffFX2::IsOkayToAttack() / A_MStaffAttack aimed at friendlies.

- Added kill count awareness to A_ChangeFlag.
- P_NightmareRespawn() now clears the MTF_AMBUSH flag, so respawned monsters
  aren't dormant (since there would be no way to activate them, and they
  were certainly not dormant when they died).


SVN r1287 (trunk)
This commit is contained in:
Randy Heit 2008-11-14 23:12:15 +00:00
commit 183b765cf2
7 changed files with 52 additions and 17 deletions

View file

@ -2216,16 +2216,39 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeFlag)
if (fd != NULL)
{
bool kill_before, kill_after;
kill_before = self->CountsAsKill();
if (fd->structoffset == -1)
{
HandleDeprecatedFlags(self, cls->ActorInfo, expression, fd->flagbit);
}
else
{
int * flagp = (int*) (((char*)self) + fd->structoffset);
int *flagp = (int*) (((char*)self) + fd->structoffset);
if (expression) *flagp |= fd->flagbit;
else *flagp &= ~fd->flagbit;
if (expression)
{
*flagp |= fd->flagbit;
}
else
{
*flagp &= ~fd->flagbit;
}
}
kill_after = self->CountsAsKill();
// Was this monster previously worth a kill but no longer is?
// Or vice versa?
if (kill_before != kill_after)
{
if (kill_after)
{ // It counts as a kill now.
level.total_monsters++;
}
else
{ // It no longer counts as a kill.
level.total_monsters--;
}
}
}
else