Mercurial > touhou
diff 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 |
line wrap: on
line diff
--- a/pytouhou/game/item.pyx +++ b/pytouhou/game/item.pyx @@ -74,17 +74,17 @@ cdef class Item(Element): return [self] - cdef void autocollect(self, Player player) except *: + cdef bint autocollect(self, Player player) except True: if self.target is None and self.player is None: self.target = player self.speed = player.sht.autocollection_speed - cdef void on_collect(self, Player player) except *: + cdef bint on_collect(self, Player player) except True: cdef long level, poc if not (self.player is None or self.player is player): - return + return False old_power = player.power score = 0