From f8708b0c31d63d069c9385239be23ad0026f2b64 Mon Sep 17 00:00:00 2001 From: ThaumRystra Date: Sun, 3 Nov 2024 15:57:32 +0200 Subject: [PATCH] Fixed point buy defined variable names not being available in actions --- app/imports/api/creature/creatures/CreatureVariables.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/imports/api/creature/creatures/CreatureVariables.ts b/app/imports/api/creature/creatures/CreatureVariables.ts index 07a35e71..c0ff7739 100644 --- a/app/imports/api/creature/creatures/CreatureVariables.ts +++ b/app/imports/api/creature/creatures/CreatureVariables.ts @@ -2,9 +2,6 @@ import { getSingleProperty } from '/imports/api/engine/loadCreatures'; import ParseNode from '/imports/parser/parseTree/ParseNode'; import array from '/imports/parser/parseTree/array'; import constant, { isFiniteNode } from '/imports/parser/parseTree/constant'; -import resolve from '/imports/parser/resolve'; -import InputProvider from '/imports/api/engine/action/functions/userInput/InputProvider'; -import Context from '/imports/parser/types/Context'; //set up the collection for creature variables const CreatureVariables = new Mongo.Collection('creatureVariables'); @@ -35,7 +32,11 @@ if (Meteor.isServer) { export function getFromScope(name: string, scope) { let value = scope?.[name]; if (value?._propId) { - value = getSingleProperty(scope._creatureId, value._propId); + const [propId, rowIdentifier, rowNumber] = value._propId.split('_'); + value = getSingleProperty(scope._creatureId, propId); + if (rowIdentifier === 'row' && value?.type === 'pointBuy') { + value = value.values[rowNumber]; + } } return value; }