From: Eric S. Raymond Date: Tue, 10 Oct 2006 01:56:31 +0000 (+0000) Subject: Fix translation error that prevented commanders from being hit by torps. X-Git-Tag: 2.0~105 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=4162df86eb0d33c39014a02075294128fd2ca84d;p=super-star-trek.git Fix translation error that prevented commanders from being hit by torps. --- diff --git a/src/sst.py b/src/sst.py index baaea8c..fbd85f9 100644 --- a/src/sst.py +++ b/src/sst.py @@ -1345,13 +1345,12 @@ def torpedo(origin, course, dispersion, number, nburst): game.sector = jw proutn(crmshp()) shoved = True - elif iquad in (IHC, IHS): # Hit a commander + elif iquad in (IHC, IHS, IHR, IHK): # Hit a regular enemy + # find the enemy if withprob(0.05): prout(crmena(True, iquad, "sector", w) + _(" uses anti-photon device;")) prout(_(" torpedo neutralized.")) return None - elif iquad in (IHR, IHK): # Hit a regular enemy - # find the enemy for enemy in game.enemies: if w == enemy.kloc: break @@ -2429,12 +2428,14 @@ def events(): for ibq in game.state.baseq: for cmdr in game.state.kcmdr: if ibq == cmdr and ibq != game.quadrant and ibq != game.state.kscmdr: - raise "foundit" - except "foundit": - # no match found -- try later - schedule(FBATTAK, expran(0.3*game.intime)) - unschedule(FCDBAS) - continue + raise ibq + else: + # no match found -- try later + schedule(FBATTAK, expran(0.3*game.intime)) + unschedule(FCDBAS) + continue + except coord: + pass # commander + starbase combination found -- launch attack game.battle = ibq schedule(FCDBAS, randreal(1.0, 4.0))