Fix handling of destroyed buildings.

This commit is contained in:
Dan Albert 2021-01-08 19:21:06 -08:00
parent 7ae934e940
commit 2d9e5fe984

View File

@ -112,7 +112,9 @@ class UnitMap:
group: Group) -> None: group: Group) -> None:
# The actual name is a String (the pydcs translatable string), which # The actual name is a String (the pydcs translatable string), which
# doesn't define __eq__. # 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: if name in self.buildings:
raise RuntimeError(f"Duplicate TGO unit: {name}") raise RuntimeError(f"Duplicate TGO unit: {name}")
self.buildings[name] = Building(ground_object) self.buildings[name] = Building(ground_object)