1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 11:47:45 +00:00

Fix signedness of scene yield params

According to the decompiled Lua code, they sometimes can return
negative numbers (like -1, to indicate an error.) I also improved
the debug display of these in the server log a bit.
This commit is contained in:
Joshua Goins 2025-06-25 23:28:12 -04:00
parent 476958a054
commit d292e1d676
3 changed files with 3 additions and 3 deletions

View file

@ -874,7 +874,7 @@ async fn client_loop(
} }
} }
ClientZoneIpcData::EventHandlerReturn { handler_id, scene, error_code, num_results, params } => { ClientZoneIpcData::EventHandlerReturn { handler_id, scene, error_code, num_results, params } => {
tracing::info!("Finishing this event... {handler_id} {error_code} {scene} {params:#?}"); tracing::info!("Finishing this event... {handler_id} {error_code} {scene} {:?}", &params[..*num_results as usize]);
connection connection
.event .event

View file

@ -418,7 +418,7 @@ pub enum ClientZoneIpcData {
scene: u16, scene: u16,
error_code: u8, error_code: u8,
num_results: u8, num_results: u8,
params: [u32; 2], params: [i32; 2],
}, },
#[br(pre_assert(*magic == ClientZoneIpcType::Config))] #[br(pre_assert(*magic == ClientZoneIpcType::Config))]
Config(Config), Config(Config),

View file

@ -86,7 +86,7 @@ impl Event {
} }
} }
pub fn finish(&mut self, scene: u16, results: &[u32], player: &mut LuaPlayer) { pub fn finish(&mut self, scene: u16, results: &[i32], player: &mut LuaPlayer) {
let mut run_script = || { let mut run_script = || {
self.lua.scope(|scope| { self.lua.scope(|scope| {
let player = scope.create_userdata_ref_mut(player)?; let player = scope.create_userdata_ref_mut(player)?;