diff --git a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts index 802cac1..8aadd6c 100644 --- a/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts +++ b/src/app/editor/gamesystem-editor/state-editor/simple-state-editor/simple-state-editor.component.ts @@ -102,9 +102,11 @@ export class SimpleStateEditorComponent implements OnInit{ onCreateCondition(state: SimpleState, condition: ScriptAccountCondition) { if(this.templateReference instanceof Character) { const templateState = state as SimpleTemplateState - console.log("CharacterRef: ", this.templateReference); - templateState.conditionMap.get(this.templateReference as Character)!.push(condition) - console.log(templateState) + if(templateState.conditionMap.has(this.templateReference)) { + templateState.conditionMap.get(this.templateReference as Character)!.push(condition) + } else { + templateState.conditionMap.set(this.templateReference as Character, [condition]) + } } else { state.addScriptAccountCondition(condition); } diff --git a/testModel/characters/Hicks Haddock.json b/testModel/characters/Hicks Haddock.json index b3934ab..7cfe07a 100644 --- a/testModel/characters/Hicks Haddock.json +++ b/testModel/characters/Hicks Haddock.json @@ -18,6 +18,16 @@ { "stateLabel": "Wütend", "conditionMap": [] + }, + { + "stateLabel": "Enttäuscht", + "conditionMap": [ + { + "scriptAccount": "Luftfeuchtigkeit", + "minValue": 0, + "maxValue": "10" + } + ] } ], "transitions": [ diff --git a/testModel/gamesystems/Characterstimmung.json b/testModel/gamesystems/Characterstimmung.json index 26fca23..1d92b66 100644 --- a/testModel/gamesystems/Characterstimmung.json +++ b/testModel/gamesystems/Characterstimmung.json @@ -13,6 +13,12 @@ "conditions": [], "stateLabel": "Wütend", "stateDescription": "" + }, + { + "initial": false, + "conditions": [], + "stateLabel": "Enttäuscht", + "stateDescription": "" } ], "transitions": [