From 467b74d816d5376c9c6bd66f20cfe6f740d2ab8b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 28 Feb 2017 13:30:49 -0500 Subject: [PATCH] Prevent crash when moving Tholian. --- sst.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.31.1