diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 48774d27..1292d8ee 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -4651,12 +4651,16 @@ void entityclass::entitycollisioncheck() for (size_t i = 0; i < entities.size(); i++) { + if (entities[i].rule != 0) + { + continue; + } //We test entity to entity for (size_t j = 0; j < entities.size(); j++) { if (i!=j) { - if (entities[i].rule == 0 && entities[j].rule == 1 && entities[j].harmful) + if (entities[j].rule == 1 && entities[j].harmful) { //player i hits enemy or enemy bullet j if (entitycollide(i, j) && !map.invincibility) @@ -4685,18 +4689,18 @@ void entityclass::entitycollisioncheck() } } } - if (entities[i].rule == 0 && entities[j].rule == 2) //Moving platforms + if (entities[j].rule == 2) //Moving platforms { if (entitycollide(i, j)) removeblockat(entities[j].xp, entities[j].yp); } - if (entities[i].rule == 0 && entities[j].rule == 3) //Entity to entity + if (entities[j].rule == 3) //Entity to entity { if(entities[j].onentity>0) { if (entitycollide(i, j)) entities[j].state = entities[j].onentity; } } - if (entities[i].rule == 0 && entities[j].rule == 4) //Player vs horizontal line! + if (entities[j].rule == 4) //Player vs horizontal line! { if(game.deathseq==-1) { @@ -4724,7 +4728,7 @@ void entityclass::entitycollisioncheck() } } } - if (entities[i].rule == 0 && entities[j].rule == 5) //Player vs vertical line! + if (entities[j].rule == 5) //Player vs vertical line! { if(game.deathseq==-1) { @@ -4738,7 +4742,7 @@ void entityclass::entitycollisioncheck() } } } - if (entities[i].rule == 0 && entities[j].rule == 6) //Player versus crumbly blocks! Special case + if (entities[j].rule == 6) //Player versus crumbly blocks! Special case { if (entities[j].onentity > 0) { @@ -4754,10 +4758,19 @@ void entityclass::entitycollisioncheck() } } } - if (game.supercrewmate) + } + } + } + if (game.supercrewmate) + { + for (size_t i = 0; i < entities.size(); i++) + { + //some extra collisions + if (entities[i].type == 14) //i is the supercrewmate + { + for (size_t j = 0; j < entities.size(); j++) { - //some extra collisions - if (entities[i].type == 14) //i is the supercrewmate + if (i != j) { if (entities[j].rule == 1 && entities[j].harmful) //j is a harmful enemy {