fix not closing lobbies

This commit is contained in:
Alberto Xamin 2022-03-25 12:39:45 +01:00
parent 3bc4bd200f
commit ccb35606e1

View File

@ -610,7 +610,7 @@ class Game:
self.is_handling_death = True
import bang.expansions.dodge_city.characters as chd
print(f'{self.name}: the killer is {player.attacker}')
if self.dd_api:
if self.dd_api and player.character and player.role:
self.dd_api.Metric.send(metric='player_death', points=[(int(time.time()), 1)], tags=["server:backend", f"host:{os.environ['HOST']}", f"char:{player.character.name}", f"role:{player.role.name}"])
if len([c for c in player.gold_rush_equipment if isinstance(c, grc.Ricercato)]) > 0 and player.attacker and player.attacker in self.players:
player.attacker.gold_nuggets += 1