revert this
This commit is contained in:
parent
5c8d21626c
commit
e075590734
@ -8,7 +8,7 @@ import { ChatBubble } from './chat-bubble';
|
||||
const chatBuilder = new CanvasUtils();
|
||||
|
||||
export class PlayerEntity extends PonyEntity {
|
||||
private uncommittedPackets: Packet[] = [];
|
||||
private uncommittedPacket: Packet = {};
|
||||
private _chats: ChatBubble[] = [];
|
||||
|
||||
constructor(public user: IcyNetUser) {
|
||||
@ -85,7 +85,7 @@ export class PlayerEntity extends PonyEntity {
|
||||
}
|
||||
|
||||
public addUncommittedChanges(packet: Packet) {
|
||||
this.uncommittedPackets.push(packet);
|
||||
this.uncommittedPacket = { ...this.uncommittedPacket, ...packet };
|
||||
}
|
||||
|
||||
public update(dt: number) {
|
||||
@ -116,8 +116,7 @@ export class PlayerEntity extends PonyEntity {
|
||||
}
|
||||
|
||||
private commitServerUpdate() {
|
||||
if (this.uncommittedPackets.length) {
|
||||
this.setFromPacket(this.uncommittedPackets.splice(0, 1)[0]);
|
||||
}
|
||||
this.setFromPacket(this.uncommittedPacket);
|
||||
this.uncommittedPacket = {};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user