Moved inventory computation to after toggles, added class levels computation

This commit is contained in:
Stefan Zermatten
2021-09-14 16:18:36 +02:00
parent 5c84836238
commit 8f93179187
23 changed files with 351 additions and 162 deletions

View File

@@ -3,8 +3,11 @@ import walkDown from '/imports/api/creature/computation/newEngine/utility/walkdo
export default function computeInactiveStatus(node){
const prop = node.node;
if (isActive(prop)) return;
prop.inactive = true;
prop.deactivatedBySelf = true;
// Unequipped items disable their children, but are not disabled themselves
if (prop.type !== 'item'){
prop.inactive = true;
prop.deactivatedBySelf = true;
}
// Mark children as inactive due to ancestor
walkDown(node.children, child => {
child.node.inactive = true;