paavohtl Claude Opus 4.6 (1M context) commited on
Commit
a6446dc
·
1 Parent(s): 4127435

fix: canonicalize landscape_property as pointer, remove arrow dump

Browse files

landscape_property (DDGame+0x468) is a heap address stored as u32.
Show as <ptr>/null instead of raw value to avoid false diff positives.

Removed arrow_sprites/arrow_gfxdirs from snapshot — confirmed identical
between constructors, not involved in the desync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

crates/openwa-core/src/engine/ddgame.rs CHANGED
@@ -2057,30 +2057,9 @@ impl crate::snapshot::Snapshot for DDGame {
2057
  write_indent(w, i)?; writeln!(w, "camera_target = ({}, {})", Fixed(self.camera_target_x), Fixed(self.camera_target_y))?;
2058
  write_indent(w, i)?; writeln!(w, "level_size = {}x{}", self.level_width, self.level_height)?;
2059
  write_indent(w, i)?; writeln!(w, "level_size_raw = {}x{}", self.level_width_raw, self.level_height_raw)?;
2060
- write_indent(w, i)?; writeln!(w, "landscape_property = {}", self.landscape_property)?;
2061
  write_indent(w, i)?; writeln!(w, "gfx_color_table = {:?}", self.gfx_color_table)?;
2062
  write_indent(w, i)?; writeln!(w, "fast_forward = req={} active={}", self.fast_forward_request, self.fast_forward_active)?;
2063
-
2064
- // Arrow sprite/gfxdir arrays (32 slots each) — show null/ptr pattern
2065
- write_indent(w, i)?; write!(w, "arrow_sprites =")?;
2066
- for (idx, &p) in self.arrow_sprites.iter().enumerate() {
2067
- if idx % 8 == 0 { write!(w, " ")?; }
2068
- write!(w, "{}", if p.is_null() { "." } else { "#" })?;
2069
- }
2070
- writeln!(w)?;
2071
- write_indent(w, i)?; write!(w, "arrow_gfxdirs =")?;
2072
- for (idx, &p) in self.arrow_gfxdirs.iter().enumerate() {
2073
- if idx % 8 == 0 { write!(w, " ")?; }
2074
- write!(w, "{}", if p.is_null() { "." } else { "#" })?;
2075
- }
2076
- writeln!(w)?;
2077
-
2078
- // Also dump arrow_sprites as raw region to catch non-pointer values
2079
- write_indent(w, i)?; writeln!(w, "arrow_sprites_raw:")?;
2080
- crate::snapshot::write_raw_region(w,
2081
- self.arrow_sprites.as_ptr() as *const u8,
2082
- core::mem::size_of_val(&self.arrow_sprites), i + 1)?;
2083
-
2084
  write_indent(w, i)?; writeln!(w, "keyboard = {}", fmt_ptr(self.keyboard as *const u8))?;
2085
  write_indent(w, i)?; writeln!(w, "display = {}", fmt_ptr(self.display as *const u8))?;
2086
  write_indent(w, i)?; writeln!(w, "sound = {}", fmt_ptr(self.sound as *const u8))?;
 
2057
  write_indent(w, i)?; writeln!(w, "camera_target = ({}, {})", Fixed(self.camera_target_x), Fixed(self.camera_target_y))?;
2058
  write_indent(w, i)?; writeln!(w, "level_size = {}x{}", self.level_width, self.level_height)?;
2059
  write_indent(w, i)?; writeln!(w, "level_size_raw = {}x{}", self.level_width_raw, self.level_height_raw)?;
2060
+ write_indent(w, i)?; writeln!(w, "landscape_property = {}", fmt_ptr(self.landscape_property as *const u8))?;
2061
  write_indent(w, i)?; writeln!(w, "gfx_color_table = {:?}", self.gfx_color_table)?;
2062
  write_indent(w, i)?; writeln!(w, "fast_forward = req={} active={}", self.fast_forward_request, self.fast_forward_active)?;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2063
  write_indent(w, i)?; writeln!(w, "keyboard = {}", fmt_ptr(self.keyboard as *const u8))?;
2064
  write_indent(w, i)?; writeln!(w, "display = {}", fmt_ptr(self.display as *const u8))?;
2065
  write_indent(w, i)?; writeln!(w, "sound = {}", fmt_ptr(self.sound as *const u8))?;