fix broken MP collisions

This commit is contained in:
RandomityGuy 2023-06-04 22:49:35 +05:30
parent ee4ad8dbcd
commit d10ef86dcf
3 changed files with 6 additions and 1 deletions

View file

@ -176,7 +176,7 @@ class PathedInterior extends InteriorObject {
return; return;
var newp = this.getAbsPos().getPosition().add(velocity.multiply(timeDelta)); var newp = this.getAbsPos().getPosition().add(velocity.multiply(timeDelta));
this.setPosition(newp.x, newp.y, newp.z); this.setPosition(newp.x, newp.y, newp.z);
this.collider.setTransform(this.getTransform()); this.setTransform(this.getTransform());
if (this.soundChannel != null) { if (this.soundChannel != null) {
var spat = this.soundChannel.getEffect(Spatialization); var spat = this.soundChannel.getEffect(Spatialization);

View file

@ -21,6 +21,7 @@ class RewindFrame {
var mpStates:Array<{ var mpStates:Array<{
curState:PIState, curState:PIState,
stopped:Bool, stopped:Bool,
position:Vector
}>; }>;
var gemCount:Int; var gemCount:Int;
var gemStates:Array<Bool>; var gemStates:Array<Bool>;
@ -62,6 +63,7 @@ class RewindFrame {
velocity: s.curState.velocity.clone(), velocity: s.curState.velocity.clone(),
}, },
stopped: s.stopped, stopped: s.stopped,
position: s.position.clone(),
}); });
} }
c.trapdoorStates = []; c.trapdoorStates = [];

View file

@ -46,6 +46,7 @@ class RewindManager {
velocity: x.velocity.clone(), velocity: x.velocity.clone(),
}, },
stopped: @:privateAccess x.stopped, stopped: @:privateAccess x.stopped,
position: x.getAbsPos().getPosition().clone(),
} }
}); });
rf.powerupStates = []; rf.powerupStates = [];
@ -136,6 +137,8 @@ class RewindManager {
level.pathedInteriors[i].targetTime = rf.mpStates[i].curState.targetTime; 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); 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; @: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 pstates = rf.powerupStates.copy();
var lmstates = rf.landMineStates.copy(); var lmstates = rf.landMineStates.copy();