From 3ffe1b2e3b24268c9520c8062ba31e11e4d819f5 Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 15 Sep 2020 15:21:34 -0700 Subject: [PATCH] Add bounds-check to entcolours in editor rendering I have no idea why neither conveyors and moving and disappearing platforms rendered in the editor or in-game use Graphics::drawentcolours(), but this needs to be bounds-checked just as I did for the in-game rendering function. --- desktop_version/src/editor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index d8a50863..f965adcd 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -2676,6 +2676,10 @@ void editorrender() fillboxabs((edentity[i].x*8)- (ed.levx*40*8),(edentity[i].y*8)- (ed.levy*30*8),16,16,graphics.getBGR(255,164,255)); break; case 2: //Threadmills & platforms + if (!INBOUNDS_VEC(obj.customplatformtile, graphics.entcolours)) + { + continue; + } tpoint.x = (edentity[i].x*8)- (ed.levx*40*8); tpoint.y = (edentity[i].y*8)- (ed.levy*30*8); drawRect = graphics.tiles_rect; @@ -2733,6 +2737,10 @@ void editorrender() } break; case 3: //Disappearing Platform + if (!INBOUNDS_VEC(obj.customplatformtile, graphics.entcolours)) + { + continue; + } tpoint.x = (edentity[i].x*8)- (ed.levx*40*8); tpoint.y = (edentity[i].y*8)- (ed.levy*30*8); drawRect = graphics.tiles_rect;