Fix bug where dying while touching a portal can lead to a crash

This commit is contained in:
James Lambert 2023-10-24 21:29:25 -06:00
parent 288407ca02
commit 5a32c2faec
2 changed files with 7 additions and 2 deletions

View file

@ -210,12 +210,13 @@ That will generate the rom at `/build/portal64.z64`
<br />
## Current New Feature TODO List
- [ ] portal hole cutting problems
- [ ] figure out why portals somtimes are in front of window
- [ ] optimize static culling
- [ ] jump animation
- [ ] crashed when dying in test chamber 05 when hit by pellet in mid air while touching a portal
- [ ] rumble pak support
- [ ] pausing while glados is speaking can end her speech early
- [x] crashed when dying in test chamber 05 when hit by pellet in mid air while touching a portal
- [x] rumble pak support
- [x] valve intro
- [x] polish up subtitles
- [x] more sound settings

View file

@ -698,6 +698,10 @@ void collisionSceneCollideDynamicPairs(struct CollisionScene* collisionScene, st
}
int collisionSceneObjectIsTouchingPortal(struct CollisionObject* object, int portalIndex) {
if (!gCollisionScene.portalTransforms[portalIndex]) {
return 0;
}
struct Simplex simplex;
struct Vector3 direction;
quatMultVector(&gCollisionScene.portalTransforms[portalIndex]->rotation, &gRight, &direction);