- 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) September 14, 2009 (Changes by Graf Zahl)
- Added PinkSilver's A_LookEx fix.
- added resources needed for MBF support. - added resources needed for MBF support.
- removed unused score items from DECORATE file. - removed unused score items from DECORATE file.
- Fixed: Argument count for UsePuzzleItem was wrong. - 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)) if (targ && targ->player && (targ->player->cheats & CF_NOTARGET))
{ {
return; return;
} }
} }
}
// [RH] Andy Baker's stealth monsters // [RH] Andy Baker's stealth monsters
if (self->flags & MF_STEALTH) 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 // Let the self wander around aimlessly looking for a fight
if (self->SeeState != NULL)
{
if (!(self->flags & MF_INCHASE)) if (!(self->flags & MF_INCHASE))
{ {
if (seestate) if (seestate)
@ -820,27 +818,33 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_LookEx)
self->SetState (seestate); self->SetState (seestate);
} }
else else
{
if (self->SeeState != NULL)
{ {
self->SetState (self->SeeState); self->SetState (self->SeeState);
} }
}
}
else else
{ {
CALL_ACTION(A_Wander, self); CALL_ACTION(A_Wander, self);
} }
} }
}
}
} }
else else
{ {
self->target = targ; //We already have a target? 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) if (self->flags & MF_AMBUSH)
{ {
dist = P_AproxDistance (targ->x - self->x, dist = P_AproxDistance (self->target->x - self->x,
targ->y - self->y); self->target->y - self->y);
if (P_CheckSight (self, self->target, 2) && if (P_CheckSight (self, self->target, 2) &&
(!minseedist || dist > minseedist) && (!minseedist || dist > minseedist) &&
(!maxseedist || dist < maxseedist)) (!maxseedist || dist < maxseedist))

View file

@ -2140,6 +2140,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Respawn)
AActor *defs = self->GetDefault(); AActor *defs = self->GetDefault();
self->health = defs->health; 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->flags = (defs->flags & ~MF_FRIENDLY) | (self->flags & MF_FRIENDLY);
self->flags2 = defs->flags2; self->flags2 = defs->flags2;
self->flags3 = (defs->flags3 & ~(MF3_NOSIGHTCHECK | MF3_HUNTPLAYERS)) | (self->flags3 & (MF3_NOSIGHTCHECK | MF3_HUNTPLAYERS)); self->flags3 = (defs->flags3 & ~(MF3_NOSIGHTCHECK | MF3_HUNTPLAYERS)) | (self->flags3 & (MF3_NOSIGHTCHECK | MF3_HUNTPLAYERS));