diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-10-30 12:12:29 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-10-30 12:34:12 +0100 |
commit | b3a8ffb3151ff6294a0126fe0b6468db830aeeba (patch) | |
tree | 4c2896731eeac4053948266461d0cb5dc42b16e4 | |
parent | 274695921c2f33420aedfb11e1f3bdf382279cbc (diff) | |
download | algeria-b3a8ffb3151ff6294a0126fe0b6468db830aeeba.tar.gz |
Change gen_action("foo") to accept actions sans arguments.
... without creating a one-element list containing a null.
-rw-r--r-- | rules.js | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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) { |