Skip to content
Snippets Groups Projects
Commit 68fbc72e authored by deuce's avatar deuce
Browse files

polled_update goes into the global scope... load()ed things do not anymore.

parent 669a36c2
No related branches found
No related tags found
No related merge requests found
...@@ -77,7 +77,7 @@ var game_dir = orig_exec_dir; ...@@ -77,7 +77,7 @@ var game_dir = orig_exec_dir;
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
if(major_ver === undefined) if(js.global.polled_update === undefined)
load(game_dir+'/warcommon.js'); load(game_dir+'/warcommon.js');
var mfile; var mfile;
...@@ -214,6 +214,7 @@ var mail_gen = 0; ...@@ -214,6 +214,7 @@ var mail_gen = 0;
function mail_line(text, ntn) function mail_line(text, ntn)
{ {
var fp; var fp;
var fname;
if(ntn <= 0 || ntn == 27) /* ignore god and rogue */ if(ntn <= 0 || ntn == 27) /* ignore god and rogue */
return; return;
...@@ -713,7 +714,7 @@ function savegame(fp) ...@@ -713,7 +714,7 @@ function savegame(fp)
game.armies.length=armycnt; game.armies.length=armycnt;
game.move_table.length=mvtcnt; game.move_table.length=mvtcnt;
game.gen=gen; game.gen=gen;
if(polled_update !== undefined) if(js.global.polled_update !== undefined)
game.polled = true; game.polled = true;
fp.write(JSON.stringify(game, null, '\t')); fp.write(JSON.stringify(game, null, '\t'));
} }
...@@ -755,7 +756,7 @@ function main(argc, argv) ...@@ -755,7 +756,7 @@ function main(argc, argv)
exit(1); exit(1);
} }
if(was_polled && polled_update === undefined) { if(was_polled && js.global.polled_update === undefined) {
print("Skipping update of "+world+" in "+game_dir) print("Skipping update of "+world+" in "+game_dir)
print("because it had a polled update"); print("because it had a polled update");
fp = new File(game_dir+'/'+GAMESAVE); fp = new File(game_dir+'/'+GAMESAVE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment