From 0592bb2155aae0d44c81ca0d00580722a4477310 Mon Sep 17 00:00:00 2001 From: leia uwu Date: Thu, 4 Jan 2024 13:52:03 -0300 Subject: [PATCH] fix: stuff --- src/net/updateMsg.ts | 2 +- src/objects/player.ts | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/net/updateMsg.ts b/src/net/updateMsg.ts index 561ebade..f10cb443 100644 --- a/src/net/updateMsg.ts +++ b/src/net/updateMsg.ts @@ -139,7 +139,7 @@ function serializePlayerStatus(s: SurvivBitStream, data: PlayerStatus[]) { s.writeBoolean(info.hasData); if (info.hasData) { - s.writeVec(info.pos, 0, 0, 1024, 1024, 16); + s.writeVec(info.pos, 0, 0, 1024, 1024, 11); s.writeBoolean(info.visible); s.writeBoolean(info.dead); s.writeBoolean(info.downed); diff --git a/src/objects/player.ts b/src/objects/player.ts index e0e8062b..555e8869 100644 --- a/src/objects/player.ts +++ b/src/objects/player.ts @@ -329,11 +329,11 @@ export class Player extends GameObject implements PlayerFullData, PlayerPartialD if (!onStair) { if (this.layer === 2) this.layer = 0; if (this.layer === 3) this.layer = 1; - // TODO - this.aimLayer = this.layer; } if (this.layer !== originalLayer) { this.setDirty(); + // TODO + this.aimLayer = this.layer; } } } @@ -530,9 +530,11 @@ export class Player extends GameObject implements PlayerFullData, PlayerPartialD if (this.dead) return; this.lastInputMsg = msg; - if (!v2.eq(this.dir, msg.toMouseDir)) this.setPartDirty(); - this.dirOld = v2.copy(this.dir); - this.dir = msg.toMouseDir; + if (!v2.eq(this.dir, msg.toMouseDir)) { + this.setPartDirty(); + this.dirOld = v2.copy(this.dir); + this.dir = msg.toMouseDir; + } this.shootHold = msg.shootHold; this.shootStart = msg.shootStart; this.toMouseLen = msg.toMouseLen;