Migrated loadCreatures to nested sets

This commit is contained in:
ThaumRystra
2023-09-28 23:00:36 +02:00
parent ece4a9391a
commit 60f542e64e
9 changed files with 106 additions and 110 deletions

View File

@@ -1,6 +1,6 @@
import recalculateCalculation from '/imports/api/engine/actions/applyPropertyByType/shared/recalculateCalculation';
import recalculateInlineCalculations from '/imports/api/engine/actions/applyPropertyByType/shared/recalculateInlineCalculations';
import { getPropertyDecendants } from '/imports/api/engine/loadCreatures';
import { getPropertyDescendants } from '/imports/api/engine/loadCreatures';
import { TreeNode, docsToForest as nodeArrayToTree } from '/imports/api/parenting/parentingFunctions';
import applyProperty from '/imports/api/engine/actions/applyProperty';
import { difference, intersection } from 'lodash';
@@ -68,7 +68,7 @@ export function applyTrigger(trigger, prop, actionContext) {
if (!trigger.silent) actionContext.addLog(content);
// Get all the trigger's properties and apply them
const properties = getPropertyDecendants(actionContext.creature._id, trigger._id);
const properties = getPropertyDescendants(actionContext.creature._id, trigger._id);
properties.sort((a, b) => a.order - b.order);
const propertyForest = nodeArrayToTree(properties);
propertyForest.forEach(node => {