From 2d9e5fe984682f7961864a0f3b2ffc2b981bb317 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 8 Jan 2021 19:21:06 -0800 Subject: [PATCH] Fix handling of destroyed buildings. --- game/unitmap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/game/unitmap.py b/game/unitmap.py index 79cad92f..d8aeaa65 100644 --- a/game/unitmap.py +++ b/game/unitmap.py @@ -112,7 +112,9 @@ class UnitMap: group: Group) -> None: # The actual name is a String (the pydcs translatable string), which # doesn't define __eq__. - name = str(group.name) + # The name of the initiator in the DCS dead event will have " object" + # appended for statics. + name = f"{group.name} object" if name in self.buildings: raise RuntimeError(f"Duplicate TGO unit: {name}") self.buildings[name] = Building(ground_object)