mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 01:29:43 +01:00
Fix 1x1 quicksand collision optimization not working
We need to replace an "or" with an "and". My best guess for this oversight happening was because of the weird ordering. The code originally did "temp < 30" first and "temp > -30" second instead of the other way around. With the weird ordering, it becomes more natural to insert an "or" instead of an "and". So I swapped around the ordering just for good measure. This is also fixed in the mobile version.
This commit is contained in:
parent
2d07090a6b
commit
be2d2e1e2a
2 changed files with 4 additions and 4 deletions
|
@ -4685,10 +4685,10 @@ void entityclass::entitycollisioncheck()
|
|||
{
|
||||
//ok; only check the actual collision if they're in a close proximity
|
||||
temp = entities[i].yp - entities[j].yp;
|
||||
if (temp < 30 || temp > -30)
|
||||
if (temp > -30 && temp < 30)
|
||||
{
|
||||
temp = entities[i].xp - entities[j].xp;
|
||||
if (temp < 30 || temp > -30)
|
||||
if (temp > -30 && temp < 30)
|
||||
{
|
||||
if (entitycollide(i, j)) entities[j].state = entities[j].onentity;
|
||||
}
|
||||
|
|
|
@ -3851,9 +3851,9 @@
|
|||
if (entities[j].onentity > 0) {
|
||||
//ok; only check the actual collision if they're in a close proximity
|
||||
temp = entities[i].yp - entities[j].yp;
|
||||
if (temp < 30 || temp > -30) {
|
||||
if (temp > -30 && temp < 30) {
|
||||
temp = entities[i].xp - entities[j].xp;
|
||||
if (temp < 30 || temp > -30) {
|
||||
if (temp > -30 && temp < 30) {
|
||||
if (entitycollide(i, j)) entities[j].state = entities[j].onentity;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue