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,
|
instance_id: u32,
|
||||||
) -> Option<(&InstanceObject, &PopRangeInstanceObject)> {
|
) -> Option<(&InstanceObject, &PopRangeInstanceObject)> {
|
||||||
// TODO: also check position!
|
// TODO: also check position!
|
||||||
for group in &self.planmap.as_ref().unwrap().chunks[0].layers {
|
if let Some(planmap) = self.planmap.as_ref() {
|
||||||
for object in &group.objects {
|
for group in &planmap.chunks[0].layers {
|
||||||
if let LayerEntryData::PopRange(pop_range) = &object.data {
|
for object in &group.objects {
|
||||||
if object.instance_id == instance_id {
|
if let LayerEntryData::PopRange(pop_range) = &object.data {
|
||||||
return Some((object, pop_range));
|
if object.instance_id == instance_id {
|
||||||
|
return Some((object, pop_range));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// For certain PopRanges (e.g. the starting position in the opening zones)
|
if let Some(planevent) = self.planevent.as_ref() {
|
||||||
for group in &self.planevent.as_ref().unwrap().chunks[0].layers {
|
// For certain PopRanges (e.g. the starting position in the opening zones)
|
||||||
for object in &group.objects {
|
for group in &planevent.chunks[0].layers {
|
||||||
if let LayerEntryData::PopRange(pop_range) = &object.data {
|
for object in &group.objects {
|
||||||
if object.instance_id == instance_id {
|
if let LayerEntryData::PopRange(pop_range) = &object.data {
|
||||||
return Some((object, pop_range));
|
if object.instance_id == instance_id {
|
||||||
|
return Some((object, pop_range));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue