diff gamelib/animal.py @ 429:42777630956a

Add ammo to things serialized and deserialized.
author Simon Cross <hodgestar@gmail.com>
date Sat, 21 Nov 2009 16:28:27 +0000
parents a356e57529ea
children 129de5883524
line wrap: on
line diff
--- a/gamelib/animal.py	Sat Nov 21 16:21:38 2009 +0000
+++ b/gamelib/animal.py	Sat Nov 21 16:28:27 2009 +0000
@@ -275,12 +275,8 @@
 
     def reload_weapon(self):
         """If we have a weapon that takes ammunition, reload it."""
-        if not self.weapons():
-            # Nothing to reload
-            return
         for weapon in self.weapons():
-            if hasattr(weapon, 'AMMUNITION'):
-                weapon.ammunition = weapon.AMMUNITION
+            weapon.refresh_ammo()
 
 class Egg(Animal):
     """An egg"""