mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
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...
This commit is contained in:
parent
fe1c8d3336
commit
fea2010204
1 changed files with 4 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue