1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-09-30 02:07:23 +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 */
case 54: /* Horizontal */
entity.type = t;
entity.onentity = 1;
entity.invis = true;
entity.life = 0; entity.life = 0;
switch (t)
{
case 51:
case 52:
entity.rule = 5;
entity.size = 6;
entity.w = 1; entity.w = 1;
entity.h = vx; entity.h = vx;
//entity.colour = 0;
entity.onentity = 1;
entity.invis=true;
if (map.custommode) customwarpmode = true;
break; break;
case 52: //Vertical Warp Line case 53:
entity.rule = 5; case 54:
entity.type = 52;
entity.size = 6;
entity.life = 0;
entity.w = 1;
entity.h = vx;
//entity.colour = 0;
entity.onentity = 1;
entity.invis=true;
if (map.custommode) customwarpmode = true;
break;
case 53: //Horizontal Warp Line
entity.rule = 7; entity.rule = 7;
entity.type = 53;
entity.size = 5; entity.size = 5;
entity.life = 0;
entity.w = vx; entity.w = vx;
entity.h = 1; entity.h = 1;
entity.onentity = 1;
entity.invis=true;
if (map.custommode) customwarpmode = true;
break; break;
case 54: //Horizontal Warp Line }
entity.rule = 7; if (map.custommode)
entity.type = 54; {
entity.size = 5; customwarpmode = true;
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