From cffc68a10d69a2994556e84998ced29981743df6 Mon Sep 17 00:00:00 2001
From: Quaternions <krakow20@gmail.com>
Date: Thu, 20 Mar 2025 20:11:16 -0700
Subject: [PATCH] use correct magic number instead of padding

---
 src/v0.rs | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/v0.rs b/src/v0.rs
index e7ad801..3177397 100644
--- a/src/v0.rs
+++ b/src/v0.rs
@@ -171,23 +171,34 @@ pub struct WorldEventReset{
 #[binrw]
 #[brw(little)]
 pub struct WorldEventButton{
-	#[br(pad_after=8)]
 	pub button_id:u32,
+	// This field does not exist in the final struct and
+	// exists purely to de/serialize the magic number.
+	#[br(temp)]
+	#[bw(ignore)]
+	#[brw(magic=b"quatdata")]
+	_magic:(),
 }
 #[binrw]
 #[brw(little)]
 pub struct WorldEventSetTime{
 	#[br(map=read_trey_double)]
-	#[br(pad_after=4)]
 	pub time:f64,
+	#[br(temp)]
+	#[bw(ignore)]
+	#[brw(magic=b"data")]
+	_magic:(),
 }
 #[binrw]
 #[brw(little)]
 pub struct WorldEventSetPaused{
 	#[br(map=|paused:u32|paused!=0)]
 	#[bw(map=|paused:&bool|*paused as u32)]
-	#[br(pad_after=8)]
 	pub paused:bool,
+	#[br(temp)]
+	#[bw(ignore)]
+	#[brw(magic=b"quatdata")]
+	_magic:(),
 }
 #[binrw]
 #[brw(little)]
@@ -279,8 +290,7 @@ pub enum FlagReason{
 	Teleport,
 	#[brw(magic=9u32)]
 	Practice,
-	// b"data"
-	#[brw(magic=1635017060u32)]
+	#[brw(magic=b"data")]
 	None,
 }
 #[binrw]