-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TR1X bug: Lara can reach trigger through closed UW gate #1419
Comments
Would this at all have anything to do with the dive roll which native TR1 doesn't have? |
No – the glitch stems from a patch added in cb928f9 to prevent Lara from voiding when a timed door closes on her. Removing it fixes the issue, but also brings the previous bug back. diff --git a/src/game/objects/general/door.c b/src/game/objects/general/door.c
index 307c5a03..58a9cdb2 100644
--- a/src/game/objects/general/door.c
+++ b/src/game/objects/general/door.c
@@ -38,10 +38,6 @@ static void Door_Shut(DOORPOS_DATA *d, ITEM_INFO *item)
return;
}
- if (item && Door_LaraDoorCollision(item)) {
- return;
- }
-
floor->index = 0;
floor->box = NO_BOX;
floor->floor = NO_HEIGHT / 256; |
Here's another propsed patch that changes the proximity check to a block check. diff --git a/src/game/objects/general/door.c b/src/game/objects/general/door.c
index 307c5a03..4a7141f7 100644
--- a/src/game/objects/general/door.c
+++ b/src/game/objects/general/door.c
@@ -23,12 +23,12 @@ static bool Door_LaraDoorCollision(ITEM_INFO *item)
if (!g_LaraItem) {
return false;
}
- int32_t max_dist = SQUARE((WALL_L * 2) >> 8);
- int32_t dx = ABS(item->pos.x - g_LaraItem->pos.x) >> 8;
- int32_t dy = ABS(item->pos.y - g_LaraItem->pos.y) >> 8;
- int32_t dz = ABS(item->pos.z - g_LaraItem->pos.z) >> 8;
- int32_t dist = SQUARE(dx) + SQUARE(dy) + SQUARE(dz);
- return dist < max_dist;
+
+ return (
+ ((item->pos.x & ~WALL_L) == (g_LaraItem->pos.x & ~WALL_L)) &&
+ ((item->pos.y & ~WALL_L) == (g_LaraItem->pos.y & ~WALL_L)) &&
+ ((item->pos.z & ~WALL_L) == (g_LaraItem->pos.z & ~WALL_L))
+ );
}
static void Door_Shut(DOORPOS_DATA *d, ITEM_INFO *item) |
Here is a test level. It's when a door isn't on a portal AFAIK; Lara certainly voids with this in TombATI. In OG, I think you can recreate it in room 42 in Atlantis if you go onto the antipad and then go back while the door's closing. |
Resolves #1419. Removes the proximity test and instead checks if Lara is on the same tile where the ghost block will spawn.
A regression since 1.1.5, possibly 1.1.4 too but I'm unable to check the latter version because it crashes.
The issue is not present in 1.1.3.
This bug manifests in 2 ways:
TombATI
TombATI.mp4
TR1X
TR1X.mp4
The text was updated successfully, but these errors were encountered: