Fix hole opening bug

This commit is contained in:
James Lambert 2022-07-10 14:43:29 -06:00
parent 589bc4a9fb
commit 66faa76851
2 changed files with 2 additions and 3 deletions

View file

@ -491,7 +491,7 @@ int portalSurfaceCutNewHole(struct Portal* portal, int portalIndex) {
void portalCheckForHoles(struct Portal* portals) {
if ((portals[1].flags & PortalFlagsNeedsNewHole) != 0 || (
portals[0].portalSurfaceIndex == portals[1].portalSurfaceIndex && (portals[0].flags & PortalFlagsNeedsNewHole) != 0
portalSurfaceAreBothOnSameSurface() && (portals[0].flags & PortalFlagsNeedsNewHole) != 0
)) {
portalSurfaceRevert(1);
portals[1].flags |= PortalFlagsNeedsNewHole;

View file

@ -292,6 +292,7 @@ int sceneOpenPortal(struct Scene* scene, struct Transform* at, int portalIndex,
portal->transform = *at;
portal->roomIndex = roomIndex;
portal->scale = 0.0f;
gCollisionScene.portalTransforms[portalIndex] = &portal->transform;
gCollisionScene.portalRooms[portalIndex] = roomIndex;
@ -300,8 +301,6 @@ int sceneOpenPortal(struct Scene* scene, struct Transform* at, int portalIndex,
portal->opacity = 0.0f;
}
portal->scale = 0.0f;
contactSolverCheckPortalContacts(&gContactSolver, &gCurrentLevel->collisionQuads[quadIndex]);
return 1;
}