mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
fix a crash on "open game"
This commit is contained in:
parent
eb5e97acc7
commit
2c16d5773d
1 changed files with 5 additions and 1 deletions
|
@ -67,6 +67,8 @@ from pysollib.settings import PACKAGE, TITLE, TOOLKIT, TOP_SIZE
|
|||
from pysollib.settings import VERSION, VERSION_TUPLE
|
||||
from pysollib.struct_new import NewStruct
|
||||
|
||||
import random2
|
||||
|
||||
import six
|
||||
from six import BytesIO
|
||||
from six.moves import range
|
||||
|
@ -3196,7 +3198,9 @@ class Game(object):
|
|||
initial_seed = random__long2str(pload(int))
|
||||
game.random = constructRandom(initial_seed)
|
||||
state = pload()
|
||||
game.random.setstate(state)
|
||||
if not (isinstance(game.random, random2.Random) and
|
||||
isinstance(state, int)):
|
||||
game.random.setstate(state)
|
||||
# if not hasattr(game.random, "origin"):
|
||||
# game.random.origin = game.random.ORIGIN_UNKNOWN
|
||||
game.loadinfo.stacks = []
|
||||
|
|
Loading…
Add table
Reference in a new issue