From d10ef86dcfc83ce046c38e6a2bc980f4ace4fe23 Mon Sep 17 00:00:00 2001 From: RandomityGuy <31925790+RandomityGuy@users.noreply.github.com> Date: Sun, 4 Jun 2023 22:49:35 +0530 Subject: [PATCH] fix broken MP collisions --- src/PathedInterior.hx | 2 +- src/rewind/RewindFrame.hx | 2 ++ src/rewind/RewindManager.hx | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PathedInterior.hx b/src/PathedInterior.hx index 6c313c6b..afcd19dc 100644 --- a/src/PathedInterior.hx +++ b/src/PathedInterior.hx @@ -176,7 +176,7 @@ class PathedInterior extends InteriorObject { return; var newp = this.getAbsPos().getPosition().add(velocity.multiply(timeDelta)); this.setPosition(newp.x, newp.y, newp.z); - this.collider.setTransform(this.getTransform()); + this.setTransform(this.getTransform()); if (this.soundChannel != null) { var spat = this.soundChannel.getEffect(Spatialization); diff --git a/src/rewind/RewindFrame.hx b/src/rewind/RewindFrame.hx index 0bca0f05..5cc7bc9e 100644 --- a/src/rewind/RewindFrame.hx +++ b/src/rewind/RewindFrame.hx @@ -21,6 +21,7 @@ class RewindFrame { var mpStates:Array<{ curState:PIState, stopped:Bool, + position:Vector }>; var gemCount:Int; var gemStates:Array; @@ -62,6 +63,7 @@ class RewindFrame { velocity: s.curState.velocity.clone(), }, stopped: s.stopped, + position: s.position.clone(), }); } c.trapdoorStates = []; diff --git a/src/rewind/RewindManager.hx b/src/rewind/RewindManager.hx index 761ce091..72cdd04f 100644 --- a/src/rewind/RewindManager.hx +++ b/src/rewind/RewindManager.hx @@ -46,6 +46,7 @@ class RewindManager { velocity: x.velocity.clone(), }, stopped: @:privateAccess x.stopped, + position: x.getAbsPos().getPosition().clone(), } }); rf.powerupStates = []; @@ -136,6 +137,8 @@ class RewindManager { level.pathedInteriors[i].targetTime = rf.mpStates[i].curState.targetTime; level.pathedInteriors[i].velocity.set(rf.mpStates[i].curState.velocity.x, rf.mpStates[i].curState.velocity.y, rf.mpStates[i].curState.velocity.z); @:privateAccess level.pathedInteriors[i].stopped = rf.mpStates[i].stopped; + level.pathedInteriors[i].setPosition(rf.mpStates[i].position.x, rf.mpStates[i].position.y, rf.mpStates[i].position.z); + level.pathedInteriors[i].setTransform(level.pathedInteriors[i].getTransform()); } var pstates = rf.powerupStates.copy(); var lmstates = rf.landMineStates.copy();