From ff8d61643827b8a95b09233183d27c75770e7e99 Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 21 Jul 2020 14:49:36 -0700 Subject: [PATCH] Use INBOUNDS() check for mapclass::warpto() There's a lot of places where the INBOUNDS() check is spelled out instead of using the macro, before the macro was introduced. Also the macro should probably be renamed INBOUNDS_VEC() to be consistent. --- desktop_version/src/Map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/Map.cpp b/desktop_version/src/Map.cpp index 9d91e19e..4851d37d 100644 --- a/desktop_version/src/Map.cpp +++ b/desktop_version/src/Map.cpp @@ -889,7 +889,7 @@ void mapclass::warpto(int rx, int ry , int t, int tx, int ty) { gotoroom(rx, ry); game.teleport = false; - if (t >= 0 && t < (int) obj.entities.size()) + if (INBOUNDS(t, obj.entities)) { obj.entities[t].xp = tx * 8; obj.entities[t].yp = (ty * 8) - obj.entities[t].h;