don't log loss in player stats when game is fstopped
This commit is contained in:
parent
34ad806341
commit
9f7dbaa7c7
@ -1129,6 +1129,8 @@ def stop_game(cli, winner = ""):
|
||||
elif len(lovers) > 2:
|
||||
cli.msg(chan, "The lovers were {0}, and {1}".format(", ".join(lovers[0:-1]), lovers[-1]))
|
||||
|
||||
# Only update if someone actually won, "" indicates everyone died or abnormal game stop
|
||||
if winner != "":
|
||||
plrl = {}
|
||||
winners = []
|
||||
for role,ppl in var.ORIGINAL_ROLES.items():
|
||||
@ -1189,6 +1191,7 @@ def stop_game(cli, winner = ""):
|
||||
iwon = True
|
||||
elif splr in var.LOVERS and splr in survived:
|
||||
for lvr in var.LOVERS[splr]:
|
||||
lvrrol = "" #somehow lvrrol wasn't set and caused a crash once
|
||||
if lvr in plrl:
|
||||
lvrrol = plrl[lvr]
|
||||
elif ("(dced)" + lvr) in plrl:
|
||||
@ -1248,10 +1251,7 @@ def stop_game(cli, winner = ""):
|
||||
if won or iwon:
|
||||
winners.append(splr)
|
||||
|
||||
size = len(survived) + len(var.DEAD)
|
||||
# Only update if someone actually won, "" indicates everyone died or abnormal game stop
|
||||
if winner != "":
|
||||
var.update_game_stats(var.CURRENT_ROLESET, size, winner)
|
||||
var.update_game_stats(var.CURRENT_ROLESET, len(survived) + len(var.DEAD), winner)
|
||||
|
||||
# spit out the list of winners
|
||||
winners.sort()
|
||||
|
Loading…
Reference in New Issue
Block a user