mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
This commit is contained in:
parent
7af264a85b
commit
2580a3604a
4 changed files with 14 additions and 6 deletions
|
|
@ -206,6 +206,7 @@ export interface BuildingState {
|
|||
team: Team,
|
||||
buildingType: BuildingType,
|
||||
buildProgress: number,
|
||||
shield: boolean,
|
||||
}
|
||||
|
||||
export interface ProjectileState {
|
||||
|
|
@ -383,7 +384,8 @@ function unpackBuilding(bytes: Uint8Array, base: number, world: WorldBoundaries)
|
|||
const y = unpack_f32(bytes[base + 2] + (bytes[base + 3] << 8), world.boundary_min.y, world.boundary_max.y);
|
||||
const team_type_health = bytes[base + 4] + (bytes[base + 5] << 8);
|
||||
const angle = unpack_angle(bytes[base + 6]);
|
||||
const health = team_type_health & 1013;
|
||||
const health = (team_type_health >> 1) & 511;
|
||||
const shield = (team_type_health & 1) == 1;
|
||||
const team = (((team_type_health >> 13) & 1) === 0) ? Team.Blue : Team.Red;
|
||||
const level = (team_type_health >> 14);
|
||||
const buildingType = ((team_type_health >> 10) & 7) as BuildingType;
|
||||
|
|
@ -397,6 +399,7 @@ function unpackBuilding(bytes: Uint8Array, base: number, world: WorldBoundaries)
|
|||
buildingType,
|
||||
level,
|
||||
buildProgress,
|
||||
shield,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue