new ground objects format & parser; place dead objects instead of removing them completely

This commit is contained in:
Vasyl Horbachenko
2018-09-12 05:19:21 +03:00
parent 6fb342a42c
commit 03fc17fae6
7 changed files with 106 additions and 99 deletions

View File

@@ -100,18 +100,13 @@ class Event:
for object_identifier in debriefing.destroyed_objects:
for cp in self.game.theater.controlpoints:
remove_ids = []
if not cp.ground_objects:
continue
for i, ground_object in enumerate(cp.ground_objects):
if ground_object.matches_string_identifier(object_identifier):
logging.info("cp {} removing ground object {}".format(cp, ground_object.string_identifier))
remove_ids.append(i)
remove_ids.reverse()
for i in remove_ids:
del cp.ground_objects[i]
logging.info("cp {} killing ground object {}".format(cp, ground_object.string_identifier))
ground_object.is_dead = True
def skip(self):
pass