From 59815df5c1481134108ebf75880ad2238a362106 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 12 May 2025 16:32:55 -0400 Subject: [PATCH] Add warning message when failing to find poprange --- resources/scripts/opening/OpeningGridania.lua | 18 +++++++++--------- src/world/lua.rs | 2 ++ src/world/zone.rs | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/resources/scripts/opening/OpeningGridania.lua b/resources/scripts/opening/OpeningGridania.lua index b451f46..e653782 100644 --- a/resources/scripts/opening/OpeningGridania.lua +++ b/resources/scripts/opening/OpeningGridania.lua @@ -2,23 +2,23 @@ POS_START = 2299848 function Scene00000(player) -player:play_scene(EVENT_ID, 00000, 4959237, 1) + player:play_scene(EVENT_ID, 00000, 4959237, 1) end function Scene00001(player) -player:play_scene(EVENT_ID, 00001, 4959237, 1) + player:play_scene(EVENT_ID, 00001, 4959237, 1) end function onEnterTerritory(player, zone) ---- move the player into the starting position -start_pos = zone:get_pop_range(POS_START) -player:set_position(start_pos) + --- move the player into the starting position + start_pos = zone:get_pop_range(POS_START) + player:set_position(start_pos) -Scene00000(player); + Scene00000(player); end function onSceneFinished(player, scene) -if scene == 0 then - Scene00001(player) - end + if scene == 0 then + Scene00001(player) end +end diff --git a/src/world/lua.rs b/src/world/lua.rs index 48052ea..cfdc2c4 100644 --- a/src/world/lua.rs +++ b/src/world/lua.rs @@ -237,6 +237,8 @@ impl UserData for Zone { y: trans[1], z: trans[2], }); + } else { + tracing::warn!("Failed to find pop range for {id}!"); } Ok(mlua::Nil) }, diff --git a/src/world/zone.rs b/src/world/zone.rs index 5baef3c..595a676 100644 --- a/src/world/zone.rs +++ b/src/world/zone.rs @@ -8,7 +8,7 @@ use physis::{ }; /// Represents a loaded zone -#[derive(Default)] +#[derive(Default, Debug)] pub struct Zone { pub id: u16, planevent: Option,