mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-15 02:54:09 -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.settings import VERSION, VERSION_TUPLE
|
||||||
from pysollib.struct_new import NewStruct
|
from pysollib.struct_new import NewStruct
|
||||||
|
|
||||||
|
import random2
|
||||||
|
|
||||||
import six
|
import six
|
||||||
from six import BytesIO
|
from six import BytesIO
|
||||||
from six.moves import range
|
from six.moves import range
|
||||||
|
@ -3196,6 +3198,8 @@ class Game(object):
|
||||||
initial_seed = random__long2str(pload(int))
|
initial_seed = random__long2str(pload(int))
|
||||||
game.random = constructRandom(initial_seed)
|
game.random = constructRandom(initial_seed)
|
||||||
state = pload()
|
state = pload()
|
||||||
|
if not (isinstance(game.random, random2.Random) and
|
||||||
|
isinstance(state, int)):
|
||||||
game.random.setstate(state)
|
game.random.setstate(state)
|
||||||
# if not hasattr(game.random, "origin"):
|
# if not hasattr(game.random, "origin"):
|
||||||
# game.random.origin = game.random.ORIGIN_UNKNOWN
|
# game.random.origin = game.random.ORIGIN_UNKNOWN
|
||||||
|
|
Loading…
Add table
Reference in a new issue