highlight ubered players
All checks were successful
CI / checks (push) Successful in 1m1s

This commit is contained in:
Robin Appelman 2025-06-26 01:43:09 +02:00
commit c96f2e6b7b
5 changed files with 39 additions and 8 deletions

View file

@ -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,
}
}