From f95dbd84264812703799cb3c3641cdede0b6200f Mon Sep 17 00:00:00 2001 From: Misa Date: Sat, 31 Oct 2020 13:44:37 -0700 Subject: [PATCH] Disable nocollisionat() for conveyors While my previous commit fixes the glitchy y-position when you get stuck inside a conveyor, I noticed that getting inside a conveyor seems to always push the player out, despite conveyors sharing the same code with moving platforms, which has code to temporarily disable their own collision when the player gets stuck inside them, so that the player DOESN'T get pushed out. Well, it turns out that the reason this happens is because conveyors in a room that get placed during mapclass::loadlevel() get tile 1 placed underneath them. This is mostly so moving platforms will collide with them, because otherwise platforms don't collide with other platforms, and a conveyor is considered a platform. This means that a conveyor without any tiles behind it will simply get the player stuck if they get inside it, and the player won't be pushed out. This is bad, because conveyors don't move, so they'll be stuck there forever until they press R (or save, quit, and load). This situation doesn't come up in the main game, but it COULD come up in custom levels that use the internal createentity() command to create conveyors that don't have any tiles behind them. It seems good to fix this as well, while we're at it fixing conveyor physics, so I'm fixing this as well. --- desktop_version/src/Entity.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/desktop_version/src/Entity.cpp b/desktop_version/src/Entity.cpp index 510bd7e3..7e953d24 100644 --- a/desktop_version/src/Entity.cpp +++ b/desktop_version/src/Entity.cpp @@ -4674,6 +4674,11 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/) } break; case 2: //Moving platforms + if (entities[j].behave >= 8 || entities[j].behave < 10) + { + //We don't want conveyors, moving platforms only + break; + } if (entitycollide(i, j)) { //Disable collision temporarily so we don't push the person out!