diff --git a/sc2reader/events/game.py b/sc2reader/events/game.py index 50a9f8f0..26fc2813 100644 --- a/sc2reader/events/game.py +++ b/sc2reader/events/game.py @@ -521,17 +521,21 @@ def __str__(self): def create_control_group_event(frame, pid, data): update_type = data["control_group_update"] - if update_type == 0: + if update_type in [0, 4]: + # 0 is the normal set command. + # 4 is used when you steal and set. If required, type 4 will be followed by autogenerated + # selection and control group events that remove the units from their other groups. return SetControlGroupEvent(frame, pid, data) - elif update_type == 1: + elif update_type in [1, 5]: + # 1 is the normal add command. + # 5 is used when you steal and add. If required, type 5 will be followed by autogenerated + # selection and control group events that remove the units from their other groups. return AddToControlGroupEvent(frame, pid, data) elif update_type == 2: return GetControlGroupEvent(frame, pid, data) elif update_type == 3: - # TODO: What could this be?!? - return ControlGroupEvent(frame, pid, data) + return DeleteControlGroupEvent(frame, pid, data) else: - # No idea what this is but we're seeing update_types of 4 and 5 in 3.0 return ControlGroupEvent(frame, pid, data) @@ -589,6 +593,15 @@ class AddToControlGroupEvent(SetControlGroupEvent): """ +class DeleteControlGroupEvent(ControlGroupEvent): + """ + Extends :class:`ControlGroupEvent` + + This event deletes the control group (all units are removed). This happens when all + units are stolen from the event group (alt, alt+shift modifiers by default). + """ + + class GetControlGroupEvent(ControlGroupEvent): """ Extends :class:`ControlGroupEvent`