From 37329ec63ede7b16d6cab879d9dcd90e5ec36e67 Mon Sep 17 00:00:00 2001 From: twanvl Date: Wed, 25 Jun 2008 12:42:20 +0000 Subject: [PATCH] Use KaywordParamValue objects for sanity checking reminder text scripts, this fixes: "Error message "String param1 has no member 'value'" when using param1.value in custom keywords." git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1002 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/data/action/keyword.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/action/keyword.cpp b/src/data/action/keyword.cpp index 7ef78c36..ba2383c4 100644 --- a/src/data/action/keyword.cpp +++ b/src/data/action/keyword.cpp @@ -181,8 +181,10 @@ bool KeywordReminderTextValue::checkScript(const ScriptP& script) { Context& ctx = set.cards.empty() ? set.getContext() : set.getContext(set.cards.front()); LocalScope scope(ctx); for (size_t i = 0 ; i < keyword.parameters.size() ; ++i) { - String param = String(_("param")) << (int)(i+1); - ctx.setVariable(param, to_script(param)); + const KeywordParam& kwp = *keyword.parameters[i]; + String param_name = String(_("param")) << (int)(i+1); + String param_value = _("") + (kwp.placeholder.empty() ? kwp.name : kwp.placeholder) + _(""); + ctx.setVariable(param_name, new_intrusive4(kwp.name, _(""), _(""), param_value)); } script->eval(ctx); errors.clear();