comparison pytouhou/game/item.pyx @ 617:a6af3ff86612

Change all “void except *” function into “bint except True”, to prevent PyErr_Occurred() from being called at each call.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 29 Mar 2015 00:08:20 +0100
parents 3c2f96f1d715
children 3168e5ff22dc
comparison
equal deleted inserted replaced
616:4ce3ef053a25 617:a6af3ff86612
72 if self.indicator is not None: 72 if self.indicator is not None:
73 return [self.indicator] 73 return [self.indicator]
74 return [self] 74 return [self]
75 75
76 76
77 cdef void autocollect(self, Player player) except *: 77 cdef bint autocollect(self, Player player) except True:
78 if self.target is None and self.player is None: 78 if self.target is None and self.player is None:
79 self.target = player 79 self.target = player
80 self.speed = player.sht.autocollection_speed 80 self.speed = player.sht.autocollection_speed
81 81
82 82
83 cdef void on_collect(self, Player player) except *: 83 cdef bint on_collect(self, Player player) except True:
84 cdef long level, poc 84 cdef long level, poc
85 85
86 if not (self.player is None or self.player is player): 86 if not (self.player is None or self.player is player):
87 return 87 return False
88 88
89 old_power = player.power 89 old_power = player.power
90 score = 0 90 score = 0
91 label = None 91 label = None
92 color = 'white' 92 color = 'white'