diff --git a/xtrn/war/warpoll.js b/xtrn/war/warpoll.js index 87b58e22ed2f94f8b532401d70b518be1fa958da..8f240742a3335aa6ee7b67395f536726a9c83d54 100644 --- a/xtrn/war/warpoll.js +++ b/xtrn/war/warpoll.js @@ -79,7 +79,7 @@ function main(argc, argv) fp = new File(game_dir+'/'+filename); turn_done = false; - if(fp.open("rb")) { + if(fp.open("rb", true)) { for(i = 0; (inbuf = fp.readln()) != null; i++) { if(inbuf.search(/^end-turn\s*$/)==0) { turn_done = true; @@ -88,6 +88,8 @@ function main(argc, argv) } fp.close(); } + else + break; if(turn_done) done_count++;