mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-04 02:34:13 +02:00
This commit is contained in:
parent
dc990db7f1
commit
c96f2e6b7b
5 changed files with 39 additions and 8 deletions
|
|
@ -168,6 +168,7 @@ export interface PlayerState {
|
|||
playerClass: Class,
|
||||
info: PlayerInfo,
|
||||
charge: number,
|
||||
ubered: boolean,
|
||||
}
|
||||
|
||||
export interface BuildingState {
|
||||
|
|
@ -290,7 +291,8 @@ function unpackPlayer(bytes: Uint8Array, base: number, world: WorldBoundaries, i
|
|||
const y = unpack_f32(bytes[base + 2] + (bytes[base + 3] << 8), world.boundary_min.y, world.boundary_max.y);
|
||||
const team_class_health = bytes[base + 4] + (bytes[base + 5] << 8);
|
||||
const angle = unpack_angle(bytes[base + 6]);
|
||||
const health = team_class_health & 1013;
|
||||
const ubered = (team_class_health & 1) == 1;
|
||||
const health = (team_class_health >> 1) & 511;
|
||||
const team = (team_class_health >> 14) as Team;
|
||||
const playerClass = ((team_class_health >> 10) & 15) as Class;
|
||||
const charge = bytes[base + 7];
|
||||
|
|
@ -302,7 +304,8 @@ function unpackPlayer(bytes: Uint8Array, base: number, world: WorldBoundaries, i
|
|||
team,
|
||||
playerClass,
|
||||
info,
|
||||
charge
|
||||
charge,
|
||||
ubered,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue