X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=src%2Fsst.py;h=143ca5363622f8776ee8b92f73e811b887216903;hb=09affba734d1dcd2972a649a845dbbfde9c2407d;hp=00f6df3dfa65ec08b449a6fa8c933283ebca08ca;hpb=c873e794bf5a029fef3a5ee5385cc0fec6220fa0;p=super-star-trek.git diff --git a/src/sst.py b/src/sst.py index 00f6df3..143ca53 100644 --- a/src/sst.py +++ b/src/sst.py @@ -649,7 +649,7 @@ def movescom(iq, avoid): game.state.kscmdr = iq game.state.galaxy[game.state.kscmdr.i][game.state.kscmdr.j].klingons += 1 if game.state.kscmdr==game.quadrant: - # SC has scooted, Remove him from current quadrant + # SC has scooted, remove him from current quadrant game.iscate=False game.isatb=0 game.ientesc = False @@ -4458,7 +4458,7 @@ def usecrystals(): skip(1) prouts(_("Scotty- \"Keep your fingers crossed, Sir!\"")) skip(1) - if with(game.cryprob): + if random.random() > game.cryprob: prouts(_(" \"Activating now! - - No good! It's***")) skip(2) prouts(_("***RED ALERT! RED A*L********************************")) @@ -6197,8 +6197,12 @@ if __name__ == '__main__': sys.stderr.write("usage: sst [-t] [-x] [startcommand...].\n") raise SystemExit, 1 # where to save the input in case of bugs + if "TMPDIR" in os.environ: + tmpdir = os.environ['TMPDIR'] + else: + tmpdir = "/tmp" try: - logfp = open("/tmp/sst-input.log", "w") + logfp = open(os.path.join(tmpdir, "sst-input.log"), "w") except IOError: sys.stderr.write("sst: warning, can't open logfile\n") sys.exit(1)