Fix undefined error when adding conditions to freshly added templatestate
All checks were successful
E2E Testing / test (push) Successful in 2m0s
All checks were successful
E2E Testing / test (push) Successful in 2m0s
This commit is contained in:
parent
803d0d4443
commit
859f207503
@ -102,9 +102,11 @@ export class SimpleStateEditorComponent implements OnInit{
|
||||
onCreateCondition(state: SimpleState, condition: ScriptAccountCondition) {
|
||||
if(this.templateReference instanceof Character) {
|
||||
const templateState = state as SimpleTemplateState<Character>
|
||||
console.log("CharacterRef: ", this.templateReference);
|
||||
if(templateState.conditionMap.has(this.templateReference)) {
|
||||
templateState.conditionMap.get(this.templateReference as Character)!.push(condition)
|
||||
console.log(templateState)
|
||||
} else {
|
||||
templateState.conditionMap.set(this.templateReference as Character, [condition])
|
||||
}
|
||||
} else {
|
||||
state.addScriptAccountCondition(condition);
|
||||
}
|
||||
|
@ -18,6 +18,16 @@
|
||||
{
|
||||
"stateLabel": "Wütend",
|
||||
"conditionMap": []
|
||||
},
|
||||
{
|
||||
"stateLabel": "Enttäuscht",
|
||||
"conditionMap": [
|
||||
{
|
||||
"scriptAccount": "Luftfeuchtigkeit",
|
||||
"minValue": 0,
|
||||
"maxValue": "10"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"transitions": [
|
||||
|
@ -13,6 +13,12 @@
|
||||
"conditions": [],
|
||||
"stateLabel": "Wütend",
|
||||
"stateDescription": ""
|
||||
},
|
||||
{
|
||||
"initial": false,
|
||||
"conditions": [],
|
||||
"stateLabel": "Enttäuscht",
|
||||
"stateDescription": ""
|
||||
}
|
||||
],
|
||||
"transitions": [
|
||||
|
Loading…
Reference in New Issue
Block a user