mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
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.
This commit is contained in:
parent
942217f871
commit
f95dbd8426
1 changed files with 5 additions and 0 deletions
|
@ -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!
|
||||
|
|
Loading…
Reference in a new issue