1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Corrections on game 'pyramid'

- For TypeError reported with #147. (clickhandler failed to return a value)
- For index out of range (in pyramid.y)
This commit is contained in:
lufebe16 2020-02-10 18:01:20 +01:00 committed by Shlomi Fish
parent d0ff5494d5
commit 2fea665242
2 changed files with 6 additions and 3 deletions

View file

@ -82,8 +82,10 @@ class Pyramid_StackMethods:
def _dropPairMove(self, n, other_stack, frames=-1, shadow=-1):
if not self.game.demo:
self.game.playSample("droppair", priority=200)
assert n == 1 and self.acceptsCards(
other_stack, [other_stack.cards[-1]])
if not (n == 1
and other_stack.cards
and self.acceptsCards(other_stack, [other_stack.cards[-1]])):
return
old_state = self.game.enterState(self.game.S_FILL)
f = self.game.s.foundations[0]
self.game.moveMove(n, self, f, frames=frames, shadow=shadow)

View file

@ -2935,9 +2935,10 @@ class FaceUpWasteTalonStack(WasteTalonStack):
self.game.fillStack(self)
def dealCards(self, sound=False):
WasteTalonStack.dealCards(self, sound=sound)
retval = WasteTalonStack.dealCards(self, sound=sound)
if self.canFlipCard():
self.flipMove()
return retval
class OpenTalonStack(TalonStack, OpenStack):