mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-22 08:49:46 +01:00
Only set game.customscript if index is inbounds
game.customscript is an unnecessary middleman, but it will be kept around for compatibility reasons. However, it's still possible to crash the game, so I'm adding this bounds check.
This commit is contained in:
parent
8c42f82317
commit
ca9e4c8f6e
1 changed files with 4 additions and 1 deletions
|
@ -1773,7 +1773,10 @@ void mapclass::loadlevel(int rx, int ry)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 19: //Script Box
|
case 19: //Script Box
|
||||||
game.customscript[tempscriptbox]=edentity[edi].scriptname;
|
if (INBOUNDS_ARR(tempscriptbox, game.customscript))
|
||||||
|
{
|
||||||
|
game.customscript[tempscriptbox]=edentity[edi].scriptname;
|
||||||
|
}
|
||||||
obj.createblock(1, (edentity[edi].x*8)- ((rx-100)*40*8), (edentity[edi].y*8)- ((ry-100)*30*8),
|
obj.createblock(1, (edentity[edi].x*8)- ((rx-100)*40*8), (edentity[edi].y*8)- ((ry-100)*30*8),
|
||||||
edentity[edi].p1*8, edentity[edi].p2*8, 300+tempscriptbox, "custom_" + edentity[edi].scriptname);
|
edentity[edi].p1*8, edentity[edi].p2*8, 300+tempscriptbox, "custom_" + edentity[edi].scriptname);
|
||||||
tempscriptbox++;
|
tempscriptbox++;
|
||||||
|
|
Loading…
Reference in a new issue