Permalink
Browse files

Merge branch 'master' into development

  • Loading branch information...
totycro committed Apr 7, 2012
2 parents e1e42b2 + 3ff7588 commit e00e423f5b75966758bb18bc00f38cfe99ffd6eb
Showing with 9 additions and 0 deletions.
  1. +1 −0 horizons/i18n/voice.py
  2. +8 −0 horizons/world/units/ship.py
View
@@ -58,6 +58,7 @@ class Speech:
MOVE_OUTSIDE_OF_WORLD = None
MOVE_INVALID_LOCATION = None
NEW_UNIT = None
+ YOU_LOST = None
BUILDING_ON_FIRE = None
DEFAULT_LANG="en"
@@ -106,6 +106,14 @@ def _move_tick(self, resume = False):
self.session.world.ship_map[self.position.to_tuple()] = weakref.ref(self)
self.session.world.ship_map[self._next_target.to_tuple()] = weakref.ref(self)
+ def _movement_finished(self):
+ if self.in_ship_map:
+ # if the movement somehow stops, the position sticks, and the unit isn't at next_target any more
+ ship = self.session.world.ship_map.get(self._next_target.to_tuple())
+ if ship is not None and ship() is self:
+ del self.session.world.ship_map[self._next_target.to_tuple()]
+ super(Ship, self)._movement_finished()
+
def go(self, x, y):
#disable the trading route
if hasattr(self, 'route'):

0 comments on commit e00e423

Please sign in to comment.