X-Git-Url: https://git.cworth.org/git?p=empires-server;a=blobdiff_plain;f=empathy.js;h=c1d150f354d9bb4207f985b7da65540d4caa8ccd;hp=a3faf5b11355f835b6b975958ed64ef5581002c9;hb=771e0ce4711a7ed723d216c28ab8d1472463d3ef;hpb=1869a242cb2c317f5a22980dfe6dbb1087610d51 diff --git a/empathy.js b/empathy.js index a3faf5b..c1d150f 100644 --- a/empathy.js +++ b/empathy.js @@ -115,11 +115,19 @@ class Empathy extends Game { } add_prompt(items, prompt_string) { - if (items > MAX_PROMPT_ITEMS) + if (items > MAX_PROMPT_ITEMS) { return { valid: false, message: `Maximum number of items is ${MAX_PROMPT_ITEMS}` }; + } + + if (items < 1) { + return { + valid: false, + message: "Category must require at least one item" + }; + } const prompt = new Prompt(this.next_prompt_id, items, prompt_string); this.next_prompt_id++;