From fea20102044243f199083416549fb595ad2c0432 Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 28 Aug 2021 13:03:04 -0700 Subject: [PATCH] Fix enemy/plat bounds not being drawn if any side touches a screen edge Enemy/platform bounds are intended to not be drawn if they cover the whole screen, since that's what their default bounds are. However, the code inadvertently made it so if ANY of the bounds touched a screen edge, the bounds wouldn't be drawn. This is because the conditionals used "and"s instead of "or"s. The proper way to write the positive conditional is "x1 is 0 and y1 is 0 and x2 is 320 and y2 is 240", and when you invert that conditional, you need to also invert all "and"s to be "or"s. This is not the first time that the game developers failed to properly negate conjunctional statements... --- desktop_version/src/editor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index 2b14eddd..4f48cc03 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -3076,8 +3076,8 @@ void editorrender(void) else { //Draw boundaries - if(room->enemyx1!=0 && room->enemyy1!=0 - && room->enemyx2!=320 && room->enemyy2!=240) + if(room->enemyx1!=0 || room->enemyy1!=0 + || room->enemyx2!=320 || room->enemyy2!=240) { fillboxabs( room->enemyx1, room->enemyy1, room->enemyx2-room->enemyx1, @@ -3085,8 +3085,8 @@ void editorrender(void) graphics.getBGR(255-(help.glow/2),64,64)); } - if(room->platx1!=0 && room->platy1!=0 - && room->platx2!=320 && room->platy2!=240) + if(room->platx1!=0 || room->platy1!=0 + || room->platx2!=320 || room->platy2!=240) { fillboxabs( room->platx1, room->platy1, room->platx2-room->platx1,