From: Stas Sergeev Date: Wed, 16 Mar 2011 17:30:50 +0000 (+0300) Subject: patch from Javier Novoa: X-Git-Tag: 2.2~115^2 X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=commitdiff_plain;h=097ac6ffc1531b44d06767be40045795a92321e5;ds=sidebyside patch from Javier Novoa: Zero out the game arrays on initialization to prevent lockups when they are randomly populated with the game data. This fixes the lockup when the game is played the second time. --- diff --git a/sst.py b/sst.py index 857f2b0..35d1433 100755 --- a/sst.py +++ b/sst.py @@ -5335,10 +5335,21 @@ def setup(): game.nkinks = game.nhelp = game.casual = game.abandoned = 0 game.iscate = game.resting = game.imine = game.icrystl = game.icraft = False game.isatb = game.state.nplankl = 0 - game.state.starkl = game.state.basekl = 0 + game.state.starkl = game.state.basekl = game.state.nworldkl = 0 game.iscraft = "onship" game.landed = False game.alive = True + + # the galaxy + game.state.galaxy = fill2d(GALSIZE, lambda i_unused, j_unused: Quadrant()) + # the starchart + game.state.chart = fill2d(GALSIZE, lambda i_unused, j_unused: Page()) + + game.state.planets = [] # Planet information + game.state.baseq = [] # Base quadrant coordinates + game.state.kcmdr = [] # Commander quadrant coordinates + game.statekscmdr = Coord() # Supercommander quadrant coordinates + # Starchart is functional but we've never seen it game.lastchart = FOREVER # Put stars in the galaxy