mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 04:00:42 +00:00
Fix an issue where the game attempts to index sprite array with -1. This occurs when runlist_DamageEnemy() is called when no source sprite for the damage is specified (an enemy burning in lava??). The game passes -1 for the 2nd parameter to this function call, and then attempts to index sprite array. Added check. Hopefully fixes crashing on the final level?
This commit is contained in:
parent
d474478800
commit
ceccc0c2ee
1 changed files with 1 additions and 1 deletions
|
@ -1816,7 +1816,7 @@ void runlist_DamageEnemy(int nSprite, int nSprite2, short nDamage)
|
||||||
runlist_SendMessageToRunRec(nRun, (nSprite2 & 0xFFFF) | 0x80000, nDamage * 4);
|
runlist_SendMessageToRunRec(nRun, (nSprite2 & 0xFFFF) | 0x80000, nDamage * 4);
|
||||||
|
|
||||||
// is there now one less creature? (has one died)
|
// is there now one less creature? (has one died)
|
||||||
if (nPreCreaturesLeft > nCreaturesLeft)
|
if (nPreCreaturesLeft > nCreaturesLeft && nSprite2 > -1)
|
||||||
{
|
{
|
||||||
if (sprite[nSprite2].statnum != 100) {
|
if (sprite[nSprite2].statnum != 100) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue