From a0d40b5d7457921226f0c4ed3cf5f421db7314cf Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 13 Apr 2021 20:20:40 -0700 Subject: [PATCH] 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. --- desktop_version/src/Logic.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Logic.cpp b/desktop_version/src/Logic.cpp index 790aaa37..b588ddd6 100644 --- a/desktop_version/src/Logic.cpp +++ b/desktop_version/src/Logic.cpp @@ -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;