mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
added linear velocity to positionStateUpdate
This commit is contained in:
parent
72dc454bd5
commit
927b12b726
2 changed files with 4 additions and 3 deletions
|
|
@ -54,7 +54,7 @@ function(Parent, Nc, Parser, Settings) {
|
||||||
|
|
||||||
if(difference.x < Settings.PUNKBUSTER_DIFFERENCE_METERS
|
if(difference.x < Settings.PUNKBUSTER_DIFFERENCE_METERS
|
||||||
|| difference.y < Settings.PUNKBUSTER_DIFFERENCE_METERS) {
|
|| difference.y < Settings.PUNKBUSTER_DIFFERENCE_METERS) {
|
||||||
this.player.doll.updatePositionState(update.p);
|
this.player.doll.updatePositionState(update);
|
||||||
} else {
|
} else {
|
||||||
// HARD UPDATE FOR SELF
|
// HARD UPDATE FOR SELF
|
||||||
console.log(this.player.user.options.nickname + ' is cheating.')
|
console.log(this.player.user.options.nickname + ' is cheating.')
|
||||||
|
|
|
||||||
|
|
@ -75,10 +75,11 @@ function (Parent, Item, Box2D, Nc) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Doll.prototype.updatePositionState = function(positionState) {
|
Doll.prototype.updatePositionState = function(update) {
|
||||||
if(!this.isAnotherPlayerNearby()) {
|
if(!this.isAnotherPlayerNearby()) {
|
||||||
this.body.SetAwake(true);
|
this.body.SetAwake(true);
|
||||||
this.body.SetPosition(positionState);
|
this.body.SetPosition(update.p);
|
||||||
|
this.body.SetLinearVelocity(update.lv);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue