1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-26 06:28: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;
break;
case 51: //Vertical Warp Line
entity.rule = 5;
entity.type = 51;
entity.size = 6;
entity.life = 0;
entity.w = 1;
entity.h = vx;
//entity.colour = 0;
/* Warp lines */
case 51: /* Vertical */
case 52: /* Vertical */
case 53: /* Horizontal */
case 54: /* Horizontal */
entity.type = t;
entity.onentity = 1;
entity.invis=true;
if (map.custommode) customwarpmode = true;
break;
case 52: //Vertical Warp Line
entity.rule = 5;
entity.type = 52;
entity.size = 6;
entity.invis = true;
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.type = 53;
entity.size = 5;
entity.life = 0;
entity.w = vx;
entity.h = 1;
entity.onentity = 1;
entity.invis=true;
if (map.custommode) customwarpmode = true;
break;
case 54: //Horizontal Warp Line
entity.rule = 7;
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;
switch (t)
{
case 51:
case 52:
entity.rule = 5;
entity.size = 6;
entity.w = 1;
entity.h = vx;
break;
case 53:
case 54:
entity.rule = 7;
entity.size = 5;
entity.w = vx;
entity.h = 1;
break;
}
if (map.custommode)
{
customwarpmode = true;
}
break;
case 55: // Crew Member (custom, collectable)
//1 - position in array