mirror of
https://codeberg.org/demostf/tf-demos-viewer.git
synced 2026-06-03 18:14:11 +02:00
building angle fixes
This commit is contained in:
parent
775c8080ac
commit
cf1dcca7fd
1 changed files with 7 additions and 1 deletions
|
|
@ -495,7 +495,11 @@ impl BuildingState {
|
|||
let position = building.position();
|
||||
let ty = BuildingType::from_building(building);
|
||||
let angle = match building {
|
||||
Building::Teleporter(teleporter) => teleporter.yaw_to_exit),
|
||||
Building::Teleporter(teleporter)
|
||||
if teleporter.is_entrance && teleporter.yaw_to_exit != 0.0 =>
|
||||
{
|
||||
teleporter.angle + (180.0 - teleporter.yaw_to_exit)
|
||||
}
|
||||
Building::Sentry(sentry) => sentry.angle,
|
||||
_ => 0.0,
|
||||
};
|
||||
|
|
@ -590,6 +594,7 @@ fn test_building_packing() {
|
|||
team: Team::Blue,
|
||||
level: 3,
|
||||
ty: BuildingType::Level1Sentry,
|
||||
build_progress: 23,
|
||||
};
|
||||
|
||||
let bytes = input.pack(&world);
|
||||
|
|
@ -600,6 +605,7 @@ fn test_building_packing() {
|
|||
assert_eq!(input.ty, unpacked.ty);
|
||||
assert_eq!(input.team, unpacked.team);
|
||||
assert_eq!(input.level, unpacked.level);
|
||||
assert_eq!(input.build_progress, unpacked.build_progress);
|
||||
|
||||
assert!(f32::abs(input.position.x - unpacked.position.x) < 0.5);
|
||||
assert!(f32::abs(input.position.y - unpacked.position.y) < 0.5);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue