Skip to content

Commit

Permalink
fixed variable set and get, was not using "value" as input/output id
Browse files Browse the repository at this point in the history
  • Loading branch information
pfcDorn committed Nov 21, 2024
1 parent 166e011 commit 1233227
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/BasicBehaveEngine/nodes/variable/VariableGet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class VariableGet extends BehaveEngineNode {
this.graphEngine.processNodeStarted(this);

const result: Record<string, IValue> = {};
result[this.variables[this._variable].id] = this.variables[this._variable];
result["value"] = this.variables[this._variable];
return result;
}
}
2 changes: 1 addition & 1 deletion src/BasicBehaveEngine/nodes/variable/VariableSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class VariableSet extends BehaveEngineNode {
override processNode(flowSocket?:string) {
const variable: IVariable = this.variables[this._variable];
this.graphEngine.clearValueEvaluationCache();
const vals = this.evaluateAllValues([variable.id]);
const vals = this.evaluateAllValues(["value"]);
this.graphEngine.processNodeStarted(this);

this.variables[this._variable].value = vals[variable.id];
Expand Down
2 changes: 1 addition & 1 deletion src/authoring/AuthoringGraphNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const AuthoringGraphNode = (props: IAuthoringGraphNodeProps) => {
if (props.data.configuration.variable !== undefined) {
const variableId: number = JSON.parse(props.data.configuration.variable);
const v: IVariable = props.data.variables[variableId];
const value: IValueSocketDescriptor = {id: v.id, types: [props.data.types[v.type].signature], value: v.value, description: 'Value Socket for this variable'}
const value: IValueSocketDescriptor = {id: "value", types: [props.data.types[v.type].signature], value: v.value, description: 'Value Socket for this variable'}

if (props.node.type === "variable/set") {
inputValuesToSet.push(value);
Expand Down

0 comments on commit 1233227

Please sign in to comment.