mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03: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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user