Permalink
Browse files

Avoid crash in last commit

  • Loading branch information...
1 parent 3ff7588 commit c3aa5b8513df7ab920bde9bf03b2f2afacb8c4bc @totycro totycro committed Apr 7, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 horizons/world/units/ship.py
@@ -109,9 +109,10 @@ def _move_tick(self, resume = False):
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()]
+ if self._next_target is not None:
+ 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):

0 comments on commit c3aa5b8

Please sign in to comment.