1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 22:18:30 +02:00

Add bounds check to use of edteleportent

edteleportent is a global variable that gets assigned whenever the
player collides with a warp token, and gets read from later down the
line in gamelogic(). While I don't know of any way to cause anything bad
with this (and I did try), storing a temporary indexing variable like
this is only bound to be a liability in the future - so we might as well
prevent badness now by adding a bounds check here.
This commit is contained in:
Misa 2021-04-13 20:20:40 -07:00 committed by Ethan Lee
parent e3145c09f2
commit a0d40b5d74

View File

@ -1188,7 +1188,7 @@ void gamelogic(void)
//Warp tokens
if (map.custommode){
if (game.teleport)
if (game.teleport && INBOUNDS_VEC(game.edteleportent, obj.entities))
{
int edi=obj.entities[game.edteleportent].behave;
int edj=obj.entities[game.edteleportent].para;