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