1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-18 10:38:31 +02:00

Use case-switch for warpdir checking

Also, there's no need to put the entire warpdir checking in an
'if(room.warpdir>0)' statement. If any of the cases is jumped to, then
you already know that's true.
This commit is contained in:
Misa 2020-07-09 03:21:18 -07:00 committed by Ethan Lee
parent 2938db057b
commit ccb3d6e974

View File

@ -1661,20 +1661,23 @@ void mapclass::loadlevel(int rx, int ry)
if(redrawbg){
graphics.backgrounddrawn = false;
}
if(room.warpdir>0){
if(room.warpdir==1){
switch (room.warpdir)
{
case 1:
warpx=true;
background=3;
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
}else if(room.warpdir==2){
break;
case 2:
warpy=true;
background=4;
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
}else if(room.warpdir==3){
break;
case 3:
warpx=true; warpy=true;
background = 5;
graphics.rcol = ed.getwarpbackground(rx-100,ry-100);
}
break;
}
roomname = room.roomname;