Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
fix: stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
leia-uwu committed Jan 4, 2024
1 parent 31641a5 commit 0592bb2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/net/updateMsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
12 changes: 7 additions & 5 deletions src/objects/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0592bb2

Please sign in to comment.