Skip to content
This repository has been archived by the owner on May 21, 2023. It is now read-only.

Commit

Permalink
Show corp/alliance that triggered kos
Browse files Browse the repository at this point in the history
  • Loading branch information
lizthegrey committed Jul 16, 2012
1 parent 347f64f commit c8f1206
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ChatKosLookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,15 @@ def koscheck(self, player):
history = self.employment_history(player)

kos = self.koscheck_internal(history[0])
in_npc_corp = (kos == NPC)

idx = 1
while kos == NPC and idx < len(history):
kos = self.koscheck_internal(history[idx])
idx = 0
while kos == NPC and (idx + 1) < len(history):
idx = idx + 1
if kos != None and kos != NPC and kos != False:
kos = LASTCORP
kos = self.koscheck_internal(history[idx])

if in_npc_corp and kos != None and kos != NPC and kos != False:
kos = '%s: %s' % (LASTCORP, history[idx])

if kos == None or kos == NPC:
kos = False
Expand All @@ -164,7 +166,7 @@ def koscheck_internal(self, entity):
kos = False
while True:
if value['kos']:
kos = value['type']
kos = '%s: %s' % (value['type'], value['label'])
if 'npc' in value and value['npc'] and not kos:
# Signal that further lookup is needed of player's last corp
return NPC
Expand Down

0 comments on commit c8f1206

Please sign in to comment.