1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-07-13 17:07:45 +00:00

Stop panicking when walking into unused zones lines

Fixes #87
This commit is contained in:
Joshua Goins 2025-07-12 09:10:17 -04:00
parent d58025e415
commit c688e93f7c
3 changed files with 11 additions and 11 deletions

2
Cargo.lock generated
View file

@ -3390,7 +3390,7 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]] [[package]]
name = "physis" name = "physis"
version = "0.5.0" version = "0.5.0"
source = "git+https://github.com/redstrate/physis#0c6383c3cc02d6526edd13f68573ca42720cf969" source = "git+https://github.com/redstrate/physis#06a9e5f4d8772f52b49373cddef993e676a6cc3b"
dependencies = [ dependencies = [
"binrw", "binrw",
"bitflags 2.9.1", "bitflags 2.9.1",

View file

@ -721,16 +721,15 @@ async fn client_loop(
// find the pop range on the other side // find the pop range on the other side
let mut game_data = game_data.lock().unwrap(); let mut game_data = game_data.lock().unwrap();
let new_zone = Zone::load(&mut game_data, exit_box.territory_type); let new_zone = Zone::load(&mut game_data, exit_box.territory_type);
let (destination_object, _) = new_zone if let Some((destination_object, _)) = new_zone
.find_pop_range(exit_box.destination_instance_id) .find_pop_range(exit_box.destination_instance_id) {
.unwrap(); // set the exit position
connection.exit_position = Some(Position {
// set the exit position x: destination_object.transform.translation[0],
connection.exit_position = Some(Position { y: destination_object.transform.translation[1],
x: destination_object.transform.translation[0], z: destination_object.transform.translation[2],
y: destination_object.transform.translation[1], });
z: destination_object.transform.translation[2], }
});
new_territory = exit_box.territory_type; new_territory = exit_box.territory_type;
} }

View file

@ -46,6 +46,7 @@ impl Zone {
let bg_path = row.Bg().into_string().unwrap(); let bg_path = row.Bg().into_string().unwrap();
let path = format!("bg/{}.lvb", &bg_path); let path = format!("bg/{}.lvb", &bg_path);
tracing::info!("Loading {}", path);
let lgb_file = game_data.resource.read(&path).unwrap(); let lgb_file = game_data.resource.read(&path).unwrap();
let lgb = Lvb::from_existing(&lgb_file).unwrap(); let lgb = Lvb::from_existing(&lgb_file).unwrap();