From: Eric S. Raymond Date: Tue, 28 Feb 2017 18:30:49 +0000 (-0500) Subject: Prevent crash when moving Tholian. X-Git-Tag: 2.2~13 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=467b74d816d5376c9c6bd66f20cfe6f740d2ab8b;p=super-star-trek.git Prevent crash when moving Tholian. --- diff --git a/sst.py b/sst.py index 3b00bd6..234d37b 100755 --- a/sst.py +++ b/sst.py @@ -319,7 +319,9 @@ class Enemy: else: self.location = Coord() self.kdist = self.kavgd = None - game.enemies.remove(self) + # Guard prevents failure on Tholian or thingy + if self in game.enemies: + game.enemies.remove(self) return motion def __repr__(self): return "<%s,%s.%f>" % (self.type, self.location, self.power) # For debugging