GraylinKim/sc2reader

type_history does not include OrbitalCommand for an OrbitalCommandFlying

Closed this issue · 1 comments

Replay: http://drop.sc/357335

OrbitalCommandFlying [2240001]
has the following type_history:

[(0, <class 'sc2reader.data.CommandCenter'>),
(3210, <class 'sc2reader.data.CommandCenter'>),
(26562, <class 'sc2reader.data.OrbitalCommandFlying'>)]

what's missing is the time of conversion to OrbitalCommand, which is what we'd need to know when it started accumulating energy.

If I correctly understand the contract of type_history, this is a bug.

The issue here was that TargetAbility events were still changing the unit type when it didn't match. We ran into this problem before when processing selection events and made a similar fix.

In this specific case, the player right clicked the CommandCenter in the same frame that the type changed to OrbitalCommand. Because game events are processed after tracker events, the TargetAbility type replaced the UnitTypeChange type at frame 3210.

Fixed in the commit above.