changeset 625:3168e5ff22dc

Cast things closer to their usage, in Item.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Wed, 08 Apr 2015 20:13:12 +0200
parents dd393fa6e988
children 13789ac717c4
files pytouhou/game/item.pyx
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pytouhou/game/item.pyx
+++ b/pytouhou/game/item.pyx
@@ -81,8 +81,6 @@ cdef class Item(Element):
 
 
     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 False
 
@@ -123,13 +121,13 @@ cdef class Item(Element):
 
         elif self._type == 1: # point
             player.points += 1
-            poc = player.sht.point_of_collection
+            poc = <long>player.sht.point_of_collection
             if player.y < poc:
                 score = 100000
                 self._game.modify_difficulty(+30)
                 color = 'yellow'
             else:
-                score = (728 - int(self.y)) * 100 #TODO: check the formula some more.
+                score = (728 - <int>(self.y)) * 100 #TODO: check the formula some more.
                 self._game.modify_difficulty(+3)
 
         elif self._type == 3: # bomb