From ec48d7bf05df5dff05157e2dc05d8338ae03c151 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Fri, 11 Oct 2013 00:00:53 +0000 Subject: [PATCH] Do not allow invalid symbol. --- xtrn/war/war.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/xtrn/war/war.js b/xtrn/war/war.js index 5af82fc230..cd2e50851b 100644 --- a/xtrn/war/war.js +++ b/xtrn/war/war.js @@ -165,6 +165,7 @@ const attrs = { 'title_symboltitle':'N', 'title_welcome':'N', 'title_anykey':'N', + 'title_nameprompt':'N', 'mailer':'N' }; @@ -2690,11 +2691,14 @@ function main(argc, argv) inbuf = inbuf.replace(' ',''); console.attributes = attrs.title_symbollist; console.print(inbuf); - console.gotoxy(11, 21); - console.attributes = attrs.title_symbolprompt; - console.print("Select Nation Mark: "); - console.cleartoeol(); - ch = console.getkeys(inbuf); + ch=''; + while(ch == '' || ch==null || inbuf.indexOf(ch)==-1) { + console.gotoxy(11, 21); + console.attributes = attrs.title_symbolprompt; + console.print("Select Nation Mark: "); + console.cleartoeol(); + ch = console.getkeys(inbuf); + } console.gotoxy(11,22); console.cleartoeol(); inbuf = "new-nation '"+name+"' "+uid+' '+c+' '+ch; -- GitLab