mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-22 08:49:46 +01:00
Use case-switch for warp line creation
No need to repeat the left part of a conditional if we can just use case-switches instead.
This commit is contained in:
parent
c7ea684c08
commit
f8e23119bf
1 changed files with 10 additions and 4 deletions
|
@ -1806,14 +1806,20 @@ void mapclass::loadlevel(int rx, int ry)
|
|||
break;
|
||||
case 50: //Warp Lines
|
||||
obj.customwarpmode=true;
|
||||
if(ent.p1==0){ //
|
||||
switch (ent.p1)
|
||||
{
|
||||
case 0: //
|
||||
obj.createentity(ex + 4, ent.p2 * 8, 51, ent.p3);
|
||||
}else if(ent.p1==1){ //Horizontal, right
|
||||
break;
|
||||
case 1: //Horizontal, right
|
||||
obj.createentity(ex + 4, ent.p2 * 8, 52, ent.p3);
|
||||
}else if(ent.p1==2){ //Vertical, top
|
||||
break;
|
||||
case 2: //Vertical, top
|
||||
obj.createentity(ent.p2 * 8, ey + 7, 53, ent.p3);
|
||||
}else if(ent.p1==3){
|
||||
break;
|
||||
case 3:
|
||||
obj.createentity(ent.p2 * 8, ey, 54, ent.p3);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue