mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Invert and use continue in room wrap for-loops
This saves one indentation level. I also fixed the comments a bit (multiline instead of single-line, "gravitron squares" instead of "SWN enemies", also commented the player exclusion from horizontal wrapping in vertically-wrapping rooms).
This commit is contained in:
parent
285fc24513
commit
29ff47cacb
1 changed files with 15 additions and 9 deletions
|
@ -961,9 +961,12 @@ void gamelogic(void)
|
|||
size_t i;
|
||||
for (i = 0; i < obj.entities.size(); ++i)
|
||||
{
|
||||
if(obj.entities[i].type<50 //Don't warp warp lines
|
||||
&& obj.entities[i].size < 12) //Don't wrap SWN enemies
|
||||
if (obj.entities[i].type >= 50 /* Don't warp warp lines */
|
||||
|| obj.entities[i].size >= 12) /* Don't warp gravitron squares */
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (game.roomx == 118 && game.roomy == 102 && obj.entities[i].rule==1 && !map.custommode)
|
||||
{
|
||||
//ascii snakes
|
||||
|
@ -1009,14 +1012,17 @@ void gamelogic(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (map.warpy && !map.towermode)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < obj.entities.size(); ++i)
|
||||
{
|
||||
if(obj.entities[i].type<50){ //Don't warp warp lines
|
||||
if (obj.entities[i].type >= 50) /* Don't warp warp lines */
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (obj.entities[i].yp <= -12)
|
||||
{
|
||||
if (obj.entities[i].isplatform)
|
||||
|
@ -1037,17 +1043,18 @@ void gamelogic(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (map.warpy && !map.warpx && !map.towermode)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < obj.entities.size(); ++i)
|
||||
{
|
||||
|
||||
if(obj.entities[i].type<50 //Don't warp warp lines
|
||||
&&obj.entities[i].rule!=0)
|
||||
if (obj.entities[i].type >= 50 /* Don't warp warp lines */
|
||||
|| obj.entities[i].rule == 0) /* Don't warp the player */
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (obj.entities[i].xp <= -30)
|
||||
{
|
||||
if (obj.entities[i].isplatform)
|
||||
|
@ -1068,7 +1075,6 @@ void gamelogic(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool screen_transition = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue