X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=sst.py;h=8edb61b3022bc6dd1132cbba0d724d6718ebad2e;hb=7c6c144476cc2ba17213c2ed0d312970c3199b91;hp=20f67b0f6e3736d8003b781fc3fad69b219c71b9;hpb=01a19174664a126d51a05c1d526f3c987cb951ca;p=super-star-trek.git diff --git a/sst.py b/sst.py index 20f67b0..8edb61b 100755 --- a/sst.py +++ b/sst.py @@ -17,6 +17,7 @@ from __future__ import print_function, division import os, sys, math, curses, time, pickle, copy, gettext, getpass import getopt, socket, locale +import codecs # This import only works on Unixes. The intention is to enable # Ctrl-P, Ctrl-N, and friends in Cmd. @@ -2858,7 +2859,7 @@ def supernova(w): for nq.i in range(GALSIZE): for nq.j in range(GALSIZE): nstars += game.state.galaxy[nq.i][nq.j].stars - if stars == 0: + if nstars == 0: return # nothing to supernova exists num = rnd.integer(nstars) + 1 for nq.i in range(GALSIZE): @@ -3522,7 +3523,7 @@ def prouts(proutsline): def cgetline(): "Get a line of input." if game.options & OPTION_CURSES: - linein = curwnd.getstr() + "\n" + linein = codecs.decode(curwnd.getstr()) + "\n" curwnd.refresh() else: if replayfp and not replayfp.closed: @@ -5356,6 +5357,8 @@ def sectscan(goodScan, i, j): 'C':LIGHTRED, 'R':LIGHTRED, 'T':LIGHTRED, + '@':LIGHTGREEN, + 'P':LIGHTGREEN, }.get(game.quad[i][j], DEFAULT)) proutn("%c " % game.quad[i][j]) textcolor(DEFAULT)