You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TargetUnitCommandEvent.target_unit vs target? #148
Originally posted by zimri-leisher July 28, 2021
I'm relatively new to this library but I think I may have found a small issue: in the TargetUnitCommandEvent class definition, there is a field called target_unit that apparently stores a reference to the unit being targeted. However, in the ContextLoader class, in the handleTargetUnitCommandEvent method, it puts a reference to the target unit into the target field. This caused a small issue for me before I figured it out, and I know it's not a big deal, but I figured I'd better post here.
and I presume that most people are using target, I think probably the right fix is to change the class definition to declare target not target_unit. What do others think?
@zimri-leisher Can you open a pull request updating that?
Activity
StoicLoofah commentedon Aug 10, 2021
Interesting. Specifically, you're referring to the definition here
sc2reader/sc2reader/events/game.py
Line 330 in c2a5407
and corresponding effort to populate it here
sc2reader/sc2reader/engine/plugins/context.py
Line 72 in c2a5407
and here
sc2reader/sc2reader/engine/plugins/context.py
Line 86 in c2a5407
Right?
Given that there are references to
targetin other places likesc2reader/sc2reader/events/game.py
Line 251 in c2a5407
and I presume that most people are using
target, I think probably the right fix is to change the class definition to declaretargetnottarget_unit. What do others think?@zimri-leisher Can you open a pull request updating that?