Spezifikationsabgleich und Regressionsnachweise abschließen
This commit is contained in:
@@ -632,6 +632,37 @@ impl CompiledModule {
|
||||
}
|
||||
}
|
||||
}
|
||||
// PARENT overrides carry design-array indices in the existing TBC4 property format.
|
||||
let mut parents: std::collections::HashMap<_, _> = self
|
||||
.objects
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(id, object)| ((id as u16, 0), object.parent.map(|id| (id, 0))))
|
||||
.collect();
|
||||
for initial in &self.form_initial {
|
||||
let object = &self.objects[initial.object as usize];
|
||||
let parent = tb_frontend::forms::property(object.class, "PARENT")
|
||||
.and_then(|(id, _)| initial.properties.get(&id));
|
||||
parents.insert(
|
||||
(initial.object, initial.index),
|
||||
match parent {
|
||||
Some(PropertyValue::Object(parent)) => {
|
||||
parent.map(|(id, index)| (id, index.unwrap_or(0)))
|
||||
}
|
||||
_ => parents[&(initial.object, 0)],
|
||||
},
|
||||
);
|
||||
}
|
||||
for key in parents.keys() {
|
||||
let mut seen = std::collections::HashSet::new();
|
||||
let mut current = Some(*key);
|
||||
while let Some(key) = current {
|
||||
if !seen.insert(key) {
|
||||
return Err(bad());
|
||||
}
|
||||
current = *parents.get(&key).ok_or_else(bad)?;
|
||||
}
|
||||
}
|
||||
for p in &self.procs {
|
||||
if p.module as usize >= self.modules.len()
|
||||
|| p.n_params as usize != p.params.len()
|
||||
|
||||
Reference in New Issue
Block a user