Fixed properties not being made inactive by toggles

This commit is contained in:
Stefan Zermatten
2021-03-02 13:56:53 +02:00
parent 89adda60ec
commit 2c0496b44b
8 changed files with 49 additions and 37 deletions

View File

@@ -7,6 +7,7 @@ export default class ComputationMemo {
constructor(props, creature){
this.statsByVariableName = {};
this.constantsByVariableName = {};
this.constantsById = {};
this.extraStatsByVariableName = {};
this.statsById = {};
this.originalPropsById = {};
@@ -77,11 +78,7 @@ export default class ComputationMemo {
}
addConstant(prop){
prop = this.registerProperty(prop);
if (
!this.constantsByVariableName[prop.variableName]
){
this.constantsByVariableName[prop.variableName] = prop
}
this.constantsById[prop._id] = prop;
}
registerProperty(prop){
this.originalPropsById[prop._id] = cloneDeep(prop);