@@ -319,12 +319,18 @@ def __init__(self, frames, data, build):
319319 #: The unit object that died
320320 self .unit = None
321321
322- #: The id of the player that killed this unit. None when not available.
322+ #: Deprecated, see :attr:`killing_player_id`
323323 self .killer_pid = data [2 ]
324324
325- #: The player object of the that killed the unit. Not always available.
325+ #: Deprecated, see :attr:`killing_player`
326326 self .killer = None
327327
328+ #: The id of the player that killed this unit. None when not available.
329+ self .killing_player_id = data [2 ]
330+
331+ #: The player object of the that killed the unit. Not always available.
332+ self .killing_player = None
333+
328334 #: The x coordinate of the center of the dying unit's footprint. Only 4 point resolution
329335 #: prior to Starcraft Patch 2.1.
330336 self .x = data [3 ]
@@ -337,24 +343,27 @@ def __init__(self, frames, data, build):
337343 self .location = (self .x , self .y )
338344
339345 #: The index portion of the killing unit's id. Available for build 27950+
340- self .killer_unit_index = None
346+ self .killing_unit_index = None
341347
342348 #: The recycle portion of the killing unit's id. Available for build 27950+
343- self .killer_unit_recycle = None
349+ self .killing_unit_recycle = None
344350
345351 #: The unique id of the unit doing the killing. Available for build 27950+
346- self .killer_unit_id = None
352+ self .killing_unit_id = None
353+
354+ #: A reference to the :class:`Unit` that killed this :class:`Unit`
355+ self .killing_unit = None
347356
348357 if build < 27950 :
349358 self .x = self .x * 4
350359 self .y = self .y * 4
351360 self .location = (self .x , self .y )
352361 else :
353362 # Starcraft patch 2.1 introduced killer unit indexes
354- self .killer_unit_index = data [5 ]
355- self .killer_unit_recycle = data [6 ]
356- if self .killer_unit_index :
357- self .killer_unit_id = self .killer_unit_index << 18 | self .killer_unit_recycle
363+ self .killing_unit_index = data [5 ]
364+ self .killing_unit_recycle = data [6 ]
365+ if self .killing_unit_index :
366+ self .killing_unit_id = self .killing_unit_index << 18 | self .killing_unit_recycle
358367
359368 def __str__ (self ):
360369 return self ._str_prefix () + "{0: >15} - Unit died {1}." .format (self .unit .owner , self .unit )
0 commit comments