Game won't terminate

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:smile: :sad: :eek: :shock: :cool: :-x :razz: :oops: :evil: :twisted: :wink: :idea: :arrow: :neutral: :mrgreen:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Game won't terminate

by Bainespal » Sat Aug 11, 2012 6:12 am

That's the opposite of what I had been assuming. I thought using the routine would be the better, more "official" method. But anyways, I'm glad it's a simple fix!

by Roody_Yogurt » Sat Aug 11, 2012 1:13 am

As http://hugo.gerynarsabode.org/index.php?title=EndGame points out, EndGame is just one of those unintuitive things. You never should call it yourself. The engine calls it automatically when you change the endflag global.

Wherever you have EndGame(1), you should just have:

Code: Select all

endflag = 1

Game won't terminate

by Bainespal » Fri Aug 10, 2012 3:33 pm

It's about time that I ask for help with a bug in T&S that I've always known about but have no leads on. When the game ends, if the player selects "Q" to quit, the game simply goes back into normal execution. You can then re-do the action that trigged the ending, and win (or die) over and over again:
*** YOU’VE WON THE GAME! ***

The game has ended. Do you want to (R)ESTART, R(E)STORE a saved game, (U)NDO your last turn, or (Q)UIT? q

>q
Are you sure you want to quit (YES or NO)? y
I assume that the problem has to be with the endflag variable, but I have no way to prove it. I tried watching endflag in the Debugger, but the watch window always shows "endflag = 0" even when the "YOU'VE WON..." message is being displayed and the interpreter is waiting for one of the options to be selected.

In the code, I trigger the endings with the EndGlag routine, like this:

Code: Select all

Endgame(1)

Top