mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 14:52:01 +00:00
Blood: fix OOB issue in aiPatrolSetMarker
This commit is contained in:
parent
1fde9f2173
commit
39547e2df5
1 changed files with 8 additions and 3 deletions
|
@ -6686,8 +6686,13 @@ void aiPatrolSetMarker(spritetype* pSprite, XSPRITE* pXSprite) {
|
||||||
// another marker which belongs that node?
|
// another marker which belongs that node?
|
||||||
|
|
||||||
int breakChance = 0;
|
int breakChance = 0;
|
||||||
pCur = &sprite[pXSprite->target]; pPrev = &sprite[pXSprite->targetX];
|
pCur = &sprite[pXSprite->target];
|
||||||
pXCur = &xsprite[pCur->extra]; pXPrev = &xsprite[pPrev->extra];
|
pXCur = &xsprite[pCur->extra];
|
||||||
|
if (pXSprite->targetX >= 0)
|
||||||
|
{
|
||||||
|
pPrev = &sprite[pXSprite->targetX];
|
||||||
|
pXPrev = &xsprite[pPrev->extra];
|
||||||
|
}
|
||||||
prev = pCur->index;
|
prev = pCur->index;
|
||||||
|
|
||||||
bool node = markerIsNode(pXCur, false);
|
bool node = markerIsNode(pXCur, false);
|
||||||
|
@ -6699,7 +6704,7 @@ void aiPatrolSetMarker(spritetype* pSprite, XSPRITE* pXSprite) {
|
||||||
for (i = headspritestat[kStatPathMarker]; i != -1; i = nextspritestat[i]) {
|
for (i = headspritestat[kStatPathMarker]; i != -1; i = nextspritestat[i]) {
|
||||||
|
|
||||||
if (sprite[i].index == pXSprite->target || !xspriRangeIsFine(sprite[i].extra)) continue;
|
if (sprite[i].index == pXSprite->target || !xspriRangeIsFine(sprite[i].extra)) continue;
|
||||||
else if (sprite[i].index == pPrev->index && node) {
|
else if (pXSprite->targetX >= 0 && sprite[i].index == pPrev->index && node) {
|
||||||
if (pXCur->data2 == pXPrev->data1)
|
if (pXCur->data2 == pXPrev->data1)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue