Comments that pointed into the maintainer's private reverse-engineering notes (a note by name, a path, a section or finding id, the analysis's own name for a client function, a process word) now carry the fact itself, cited by the reference client's address, by vmangos file and line, or as "the reference". Nobody outside could follow those pointers. Comment text only, plus the test-assert and log strings that carried the same pointers. No claim changes: a comment the notes have since corrected keeps its wording here, and correcting it is separate work. The two reference generators, `scripts/gen-reference-globals.py` and `scripts/gen-reference-verb-events.py`, named the private notes' layout to find their inputs. They now take the input files as arguments (`--capture`, `--framexml`, `--names`, `--extents`, `--disasm`). Run on the same inputs, both write the committed tables row for row; only the two header lines that named the old environment variable change. Checked per file: - the code is identical: each file with its comments stripped compares equal before and after; a changed string literal is compared under a mask that proves only literal text moved and every literal kept its line count; - no client address the old text cited was dropped; - a second reviewer checked every added address against its derivation; - a detector for the notes' names, paths, ids, function names and process words finds none left; - `scripts/gates.sh` is green. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
45 lines
2.0 KiB
Rust
45 lines
2.0 KiB
Rust
//! WMO MFOG + group fog-index parse — byte check against the Goldshire inn (the interior-fog
|
|
//! fold's reference building). Pins the MFOG
|
|
//! record decode AND the MOGP fog-index disk offset (`0x30` — an earlier from-memory `0x40`
|
|
//! guess read zeros there; the `uniqueID @0x38` / no-liquid `@0x34` neighbours self-validate
|
|
//! the layout). Skips when the client isn't present.
|
|
|
|
use benilla_formats::{parse_wmo_fogs, wmo_group_header, Chain};
|
|
|
|
#[test]
|
|
fn goldshire_inn_fogs_and_group_indices() {
|
|
let data = benilla_formats::wow_data_or_skip!();
|
|
let reader = Chain::open(&data).expect("open vanilla patch chain");
|
|
let root = reader
|
|
.read("World\\wmo\\Azeroth\\Buildings\\GoldshireInn\\GoldshireInn.wmo")
|
|
.expect("read GoldshireInn.wmo");
|
|
|
|
// Two MFOG records: the WMO default (the selector's seed, record 0) and a denser room fog.
|
|
// Both are the warm tavern cream the storm veil must fade toward indoors.
|
|
let fogs = parse_wmo_fogs(&root);
|
|
assert_eq!(fogs.len(), 2, "inn should carry 2 MFOG records");
|
|
assert!((fogs[0].fog_end - 194.44444).abs() < 1e-3);
|
|
assert!((fogs[0].fog_start_scalar - 0.25).abs() < 1e-6);
|
|
assert_eq!(fogs[0].color, 0xfffad890, "record 0: warm cream (ARGB)");
|
|
assert_eq!(fogs[1].flags, 0x1);
|
|
assert!((fogs[1].fog_end - 83.333336).abs() < 1e-3);
|
|
assert_eq!(fogs[1].color, 0xfffdcf9e);
|
|
|
|
// Group fog indices at disk +0x30: the tavern rooms point at record 1, the rest at the
|
|
// default. area_table_id doubles as the layout's self-check (893.. = the inn's rows).
|
|
let group = |gi: u32| {
|
|
let bytes = reader
|
|
.read(&format!(
|
|
"World\\wmo\\Azeroth\\Buildings\\GoldshireInn\\GoldshireInn_{gi:03}.wmo"
|
|
))
|
|
.expect("read inn group");
|
|
wmo_group_header(&bytes).expect("group header")
|
|
};
|
|
let g0 = group(0);
|
|
assert_eq!(g0.area_table_id, 893);
|
|
assert_eq!(g0.fog_indices, [1, 0, 0, 0]);
|
|
let g2 = group(2);
|
|
assert_eq!(g2.area_table_id, 895);
|
|
assert_eq!(g2.fog_indices, [0, 0, 0, 0]);
|
|
}
|