mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-05-04 00:21:37 +00:00
fix checkpoint gravity thing
This commit is contained in:
parent
fab07bc51b
commit
6f7b0b5c7b
1 changed files with 11 additions and 1 deletions
|
|
@ -1481,11 +1481,21 @@ class MarbleWorld extends Scheduler {
|
||||||
if (this.currentCheckpoint.elem.fields.exists('add')) {
|
if (this.currentCheckpoint.elem.fields.exists('add')) {
|
||||||
add = this.currentCheckpoint.elem.fields.get('add')[0];
|
add = this.currentCheckpoint.elem.fields.get('add')[0];
|
||||||
}
|
}
|
||||||
|
var sub = "";
|
||||||
|
if (this.currentCheckpoint.elem.fields.exists('sub')) {
|
||||||
|
sub = this.currentCheckpoint.elem.fields.get('sub')[0];
|
||||||
|
}
|
||||||
if (this.currentCheckpointTrigger != null) {
|
if (this.currentCheckpointTrigger != null) {
|
||||||
offset = this.currentCheckpointTrigger.add;
|
offset = this.currentCheckpointTrigger.add;
|
||||||
}
|
}
|
||||||
if (add != "")
|
if (add != "") {
|
||||||
offset = MisParser.parseVector3(add);
|
offset = MisParser.parseVector3(add);
|
||||||
|
offset.x = -offset.x;
|
||||||
|
}
|
||||||
|
if (sub != "") {
|
||||||
|
offset = MisParser.parseVector3(sub).multiply(-1);
|
||||||
|
offset.x = -offset.x;
|
||||||
|
}
|
||||||
var mpos = this.currentCheckpoint.obj.getAbsPos().getPosition().add(offset);
|
var mpos = this.currentCheckpoint.obj.getAbsPos().getPosition().add(offset);
|
||||||
this.marble.setPosition(mpos.x, mpos.y, mpos.z);
|
this.marble.setPosition(mpos.x, mpos.y, mpos.z);
|
||||||
marble.velocity.load(new Vector(0, 0, 0));
|
marble.velocity.load(new Vector(0, 0, 0));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue