mirror of
https://github.com/redstrate/Kawari.git
synced 2025-05-19 17:27:45 +00:00
Don't panic if LGBs failed to load
This commit is contained in:
parent
d7499e6015
commit
f37aa53011
1 changed files with 15 additions and 11 deletions
|
@ -79,22 +79,26 @@ impl Zone {
|
|||
instance_id: u32,
|
||||
) -> Option<(&InstanceObject, &PopRangeInstanceObject)> {
|
||||
// TODO: also check position!
|
||||
for group in &self.planmap.as_ref().unwrap().chunks[0].layers {
|
||||
for object in &group.objects {
|
||||
if let LayerEntryData::PopRange(pop_range) = &object.data {
|
||||
if object.instance_id == instance_id {
|
||||
return Some((object, pop_range));
|
||||
if let Some(planmap) = self.planmap.as_ref() {
|
||||
for group in &planmap.chunks[0].layers {
|
||||
for object in &group.objects {
|
||||
if let LayerEntryData::PopRange(pop_range) = &object.data {
|
||||
if object.instance_id == instance_id {
|
||||
return Some((object, pop_range));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// For certain PopRanges (e.g. the starting position in the opening zones)
|
||||
for group in &self.planevent.as_ref().unwrap().chunks[0].layers {
|
||||
for object in &group.objects {
|
||||
if let LayerEntryData::PopRange(pop_range) = &object.data {
|
||||
if object.instance_id == instance_id {
|
||||
return Some((object, pop_range));
|
||||
if let Some(planevent) = self.planevent.as_ref() {
|
||||
// For certain PopRanges (e.g. the starting position in the opening zones)
|
||||
for group in &planevent.chunks[0].layers {
|
||||
for object in &group.objects {
|
||||
if let LayerEntryData::PopRange(pop_range) = &object.data {
|
||||
if object.instance_id == instance_id {
|
||||
return Some((object, pop_range));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue