diff --git a/resources/scripts/Global.lua b/resources/scripts/Global.lua index f1962d0..7beea3a 100644 --- a/resources/scripts/Global.lua +++ b/resources/scripts/Global.lua @@ -68,6 +68,7 @@ registerEvent(131205, "common/GenericWarp.lua") -- Exit Cloud Nine to Ishgard: F registerEvent(131246, "common/GenericWarp.lua") -- Exit Bokairo Inn to Kugane registerEvent(131312, "common/GenericWarp.lua") -- Exit The Pendants Personal Suite to Crystarium registerEvent(131402, "common/GenericWarp.lua") -- Exit Andron to Old Sharlayan +registerEvent(131428, "common/GenericWarp.lua") -- Mothercrystal Exit (note: warp doesn't work for some reason?) registerEvent(131578, "common/GenericWarp.lua") -- Exit The For'ard Cabins to Tuliyollal registerEvent(327683, "common/GenericAetheryte.lua") -- Bentbranch Meadows Aetheryte registerEvent(720916, "custom/000/cmndefinnbed_00020.lua") diff --git a/resources/scripts/common/GenericWarp.lua b/resources/scripts/common/GenericWarp.lua index 5ff175e..38e0596 100644 --- a/resources/scripts/common/GenericWarp.lua +++ b/resources/scripts/common/GenericWarp.lua @@ -9,6 +9,6 @@ function onReturn(scene, results, player) if results[1] == 1 then -- get warp - player:warp(EVENT_ID) + player:warp(EVENT_ID) end end diff --git a/src/world/connection.rs b/src/world/connection.rs index 788b427..eb6229f 100644 --- a/src/world/connection.rs +++ b/src/world/connection.rs @@ -384,14 +384,18 @@ impl ZoneConnection { let new_zone = Zone::load(&mut game_data.game_data, zone_id); // find it on the other side - let (object, _) = new_zone.find_pop_range(pop_range_id).unwrap(); - - // set the exit position - self.exit_position = Some(Position { - x: object.transform.translation[0], - y: object.transform.translation[1], - z: object.transform.translation[2], - }); + if let Some((object, _)) = new_zone.find_pop_range(pop_range_id) { + self.exit_position = Some(Position { + x: object.transform.translation[0], + y: object.transform.translation[1], + z: object.transform.translation[2], + }); + } else { + tracing::warn!( + "Failed to find pop range in {}. Falling back to 0,0,0!", + new_zone.id + ); + } territory_type = zone_id; }