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:
Misa authored and Ethan Lee committed 2020-05-13 08:16:34 -04:00
1 parent 2d07090a6b
commit be2d2e1e2a
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -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;
}