Commit 6411814b authored by Ahmad Reza Cheraghi's avatar Ahmad Reza Cheraghi
Browse files

Replace tile.py

parent 377f1e62
......@@ -108,7 +108,8 @@ class Tile:
"""
if coords==0:
if self.__isCarried == False:
del self.world.tile_map[self.coords]
if self.coords in self.world.tile_map:
del self.world.tile_map[self.coords]
self.__isCarried = True
self.touch()
return True
......@@ -116,7 +117,8 @@ class Tile:
return False
else:
if self.__isCarried == False:
del self.world.tile_map[self.coords]
if self.coords in self.world.tile_map:
del self.world.tile_map[self.coords]
self.__isCarried = True
self.coords = coords
self.touch()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment