From dbfd5fccc4e51c68c96d0def8e0e483f169cafc4 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 11 Apr 2025 08:46:54 -0400 Subject: [PATCH] Use bool type in ToggleInvisible Actor Control --- src/bin/kawari-world.rs | 2 +- src/world/ipc/actor_control.rs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bin/kawari-world.rs b/src/bin/kawari-world.rs index f979fd5..96ebc55 100644 --- a/src/bin/kawari-world.rs +++ b/src/bin/kawari-world.rs @@ -608,7 +608,7 @@ async fn client_loop( .actor_control_self(ActorControlSelf { category: ActorControlCategory::ToggleInvisibility { - invisible: 1, + invisible: true, }, }) .await diff --git a/src/world/ipc/actor_control.rs b/src/world/ipc/actor_control.rs index 6e97d11..8096905 100644 --- a/src/world/ipc/actor_control.rs +++ b/src/world/ipc/actor_control.rs @@ -1,5 +1,7 @@ use binrw::binrw; +use crate::common::{read_bool_from, write_bool_as}; + use super::OnlineStatus; // See https://github.com/awgil/ffxiv_reverse/blob/f35b6226c1478234ca2b7149f82d251cffca2f56/vnetlog/vnetlog/ServerIPC.cs#L266 for a REALLY useful list of known values @@ -9,7 +11,9 @@ pub enum ActorControlCategory { #[brw(magic = 0x26u16)] ToggleInvisibility { #[brw(pad_before = 2)] - invisible: u32, // FIXME: change to bool + #[br(map = read_bool_from::)] + #[bw(map = write_bool_as::)] + invisible: bool, }, #[brw(magic = 0xC8u16)] ZoneIn { @@ -43,7 +47,7 @@ pub struct ActorControl { impl Default for ActorControl { fn default() -> Self { Self { - category: ActorControlCategory::ToggleInvisibility { invisible: 1 }, + category: ActorControlCategory::ToggleInvisibility { invisible: false }, } } } @@ -60,7 +64,7 @@ pub struct ActorControlSelf { impl Default for ActorControlSelf { fn default() -> Self { Self { - category: ActorControlCategory::ToggleInvisibility { invisible: 1 }, + category: ActorControlCategory::ToggleInvisibility { invisible: false }, } } }