mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-15 02:54:09 -04:00
fixed2: allow game restore to accept older storage format.
This commit is contained in:
parent
97267e9a77
commit
92f2d5f602
1 changed files with 8 additions and 1 deletions
|
@ -3135,7 +3135,14 @@ class Game(object):
|
||||||
def pload(t=None, p=p):
|
def pload(t=None, p=p):
|
||||||
obj = p.load()
|
obj = p.load()
|
||||||
if isinstance(t, type):
|
if isinstance(t, type):
|
||||||
assert isinstance(obj, t), err_txt
|
if not isinstance(obj, t):
|
||||||
|
# accept old storage format in case:
|
||||||
|
if (t == GameMoves
|
||||||
|
or t == GameGlobalStatsStruct
|
||||||
|
or t == GameStatsStruct):
|
||||||
|
assert isinstance(obj, Struct), err_txt
|
||||||
|
else:
|
||||||
|
assert False, err_txt
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
def validate(v, txt):
|
def validate(v, txt):
|
||||||
|
|
Loading…
Add table
Reference in a new issue