From b3a8ffb3151ff6294a0126fe0b6468db830aeeba Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 30 Oct 2023 12:12:29 +0100 Subject: Change gen_action("foo") to accept actions sans arguments. ... without creating a one-element list containing a null. --- rules.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 26e240b..71c970f 100644 --- a/rules.js +++ b/rules.js @@ -984,9 +984,13 @@ exports.scenarios = [ "1954", "1958", "1960" ] exports.roles = [ FLN_NAME, GOV_NAME ] function gen_action(action, argument) { - if (!(action in view.actions)) - view.actions[action] = [] - view.actions[action].push(argument) + if (argument === undefined) { + view.actions[action] = 1 + } else { + if (!(action in view.actions)) + view.actions[action] = [] + view.actions[action].push(argument) + } } function gen_action_unit(u) { -- cgit v1.2.3