- Added PinkSilver's A_LookEx fix.

SVN r1828 (trunk)
This commit is contained in:
Christoph Oelckers 2009-09-14 23:54:55 +00:00
parent 4a057c1fdc
commit 923bf08cdc
3 changed files with 36 additions and 27 deletions

View File

@ -1,4 +1,5 @@
September 14, 2009 (Changes by Graf Zahl)
- Added PinkSilver's A_LookEx fix.
- added resources needed for MBF support.
- removed unused score items from DECORATE file.
- Fixed: Argument count for UsePuzzleItem was wrong.

View File

@ -782,13 +782,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
}
}
}
}
if (targ && targ->player && (targ->player->cheats & CF_NOTARGET))
{
return;
}
}
}
// [RH] Andy Baker's stealth monsters
if (self->flags & MF_STEALTH)
@ -811,8 +811,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
}
// Let the self wander around aimlessly looking for a fight
if (self->SeeState != NULL)
{
if (!(self->flags & MF_INCHASE))
{
if (seestate)
@ -820,27 +818,33 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
self->SetState (seestate);
}
else
{
if (self->SeeState != NULL)
{
self->SetState (self->SeeState);
}
}
}
else
{
CALL_ACTION(A_Wander, self);
}
}
}
}
}
else
{
self->target = targ; //We already have a target?
if (targ != NULL)
// [KS] The target can become ourselves in rare circumstances (like
// if we committed suicide), so if that's the case, just ignore it.
if (self->target == self) self->target = NULL;
if (self->target != NULL)
{
if (self->flags & MF_AMBUSH)
{
dist = P_AproxDistance (targ->x - self->x,
targ->y - self->y);
dist = P_AproxDistance (self->target->x - self->x,
self->target->y - self->y);
if (P_CheckSight (self, self->target, 2) &&
(!minseedist || dist > minseedist) &&
(!maxseedist || dist < maxseedist))

View File

@ -2140,6 +2140,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Respawn)
AActor *defs = self->GetDefault();
self->health = defs->health;
// [KS] Don't keep target, because it could be self if the monster committed suicide
self->target = NULL;
self->LastHeard = NULL;
self->flags = (defs->flags & ~MF_FRIENDLY) | (self->flags & MF_FRIENDLY);
self->flags2 = defs->flags2;
self->flags3 = (defs->flags3 & ~(MF3_NOSIGHTCHECK | MF3_HUNTPLAYERS)) | (self->flags3 & (MF3_NOSIGHTCHECK | MF3_HUNTPLAYERS));