mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-23 17:31:14 +00:00
- Exhumed: Repair OOB seq access with Anubis.
* Everytime `nAction` changes, `nFrame` must be reset as well. * One `AnubisSeq[]` index has an `nSeqId` of `-1`, this must be handled.
This commit is contained in:
parent
27b9b0d2f8
commit
ba8bdf347e
1 changed files with 8 additions and 1 deletions
|
@ -226,6 +226,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
{
|
||||
// Don't let Anubis get stuck in this state and allow him to acquire a new target.
|
||||
ap->nAction = 0;
|
||||
ap->nFrame = 0;
|
||||
ap->nCount = 50;
|
||||
}
|
||||
}
|
||||
|
@ -239,6 +240,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
if (pTarget == nullptr)
|
||||
{
|
||||
ap->nAction = 0;
|
||||
ap->nFrame = 0;
|
||||
ap->nCount = 50;
|
||||
}
|
||||
else
|
||||
|
@ -246,6 +248,7 @@ void AIAnubis::Tick(RunListEvent* ev)
|
|||
if (PlotCourseToSprite(ap, pTarget) >= 48)
|
||||
{
|
||||
ap->nAction = 1;
|
||||
ap->nFrame = 0;
|
||||
}
|
||||
else if (seqFrame.flags & 0x80)
|
||||
{
|
||||
|
@ -342,7 +345,11 @@ void AIAnubis::Draw(RunListEvent* ev)
|
|||
if (const auto ap = ev->pObjActor)
|
||||
{
|
||||
const auto anubisSeq = &AnubisSeq[ap->nAction];
|
||||
seq_PlotSequence(ev->nParam, ap->nSeqFile, anubisSeq->nSeqId, ap->nFrame, anubisSeq->nFlags);
|
||||
|
||||
if (anubisSeq->nSeqId >= 0)
|
||||
{
|
||||
seq_PlotSequence(ev->nParam, ap->nSeqFile, anubisSeq->nSeqId, ap->nFrame, anubisSeq->nFlags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue