1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 23:48:30 +02:00

De-duplicate warp line creation in createentity()

Copy-pasted code begone. This makes it much clearer what the difference
between all the warp line entities in this function are.
This commit is contained in:
Misa 2021-03-25 18:57:53 -07:00 committed by Ethan Lee
parent c8f4c37c88
commit 8fd7210d37

View File

@ -1954,51 +1954,36 @@ void entityclass::createentity( float xp, float yp, int t, float vx /*= 0*/, flo
entity.size = 13; entity.size = 13;
break; break;
case 51: //Vertical Warp Line /* Warp lines */
entity.rule = 5; case 51: /* Vertical */
entity.type = 51; case 52: /* Vertical */
entity.size = 6; case 53: /* Horizontal */
entity.life = 0; case 54: /* Horizontal */
entity.w = 1; entity.type = t;
entity.h = vx;
//entity.colour = 0;
entity.onentity = 1; entity.onentity = 1;
entity.invis=true; entity.invis = true;
if (map.custommode) customwarpmode = true;
break;
case 52: //Vertical Warp Line
entity.rule = 5;
entity.type = 52;
entity.size = 6;
entity.life = 0; entity.life = 0;
entity.w = 1; switch (t)
entity.h = vx; {
//entity.colour = 0; case 51:
entity.onentity = 1; case 52:
entity.invis=true; entity.rule = 5;
if (map.custommode) customwarpmode = true; entity.size = 6;
break; entity.w = 1;
case 53: //Horizontal Warp Line entity.h = vx;
entity.rule = 7; break;
entity.type = 53; case 53:
entity.size = 5; case 54:
entity.life = 0; entity.rule = 7;
entity.w = vx; entity.size = 5;
entity.h = 1; entity.w = vx;
entity.onentity = 1; entity.h = 1;
entity.invis=true; break;
if (map.custommode) customwarpmode = true; }
break; if (map.custommode)
case 54: //Horizontal Warp Line {
entity.rule = 7; customwarpmode = true;
entity.type = 54; }
entity.size = 5;
entity.life = 0;
entity.w = vx;
entity.h = 1;
entity.onentity = 1;
entity.invis=true;
if (map.custommode) customwarpmode = true;
break; break;
case 55: // Crew Member (custom, collectable) case 55: // Crew Member (custom, collectable)
//1 - position in array //1 - position in array