@@ -313,12 +313,18 @@ def __init__(self, frames, data, build):
313313 #: The unit object that died
314314 self .unit = None
315315
316- #: The id of the player that killed this unit. None when not available.
316+ #: Deprecated, see :attr:`killing_player_id`
317317 self .killer_pid = data [2 ]
318318
319- #: The player object of the that killed the unit. Not always available.
319+ #: Deprecated, see :attr:`killing_player`
320320 self .killer = None
321321
322+ #: The id of the player that killed this unit. None when not available.
323+ self .killing_player_id = data [2 ]
324+
325+ #: The player object of the that killed the unit. Not always available.
326+ self .killing_player = None
327+
322328 #: The x coordinate of the center of the dying unit's footprint. Only 4 point resolution
323329 #: prior to Starcraft Patch 2.1.
324330 self .x = data [3 ]
@@ -331,24 +337,27 @@ def __init__(self, frames, data, build):
331337 self .location = (self .x , self .y )
332338
333339 #: The index portion of the killing unit's id. Available for build 27950+
334- self .killer_unit_index = None
340+ self .killing_unit_index = None
335341
336342 #: The recycle portion of the killing unit's id. Available for build 27950+
337- self .killer_unit_recycle = None
343+ self .killing_unit_recycle = None
338344
339345 #: The unique id of the unit doing the killing. Available for build 27950+
340- self .killer_unit_id = None
346+ self .killing_unit_id = None
347+
348+ #: A reference to the :class:`Unit` that killed this :class:`Unit`
349+ self .killing_unit = None
341350
342351 if build < 27950 :
343352 self .x = self .x * 4
344353 self .y = self .y * 4
345354 self .location = (self .x , self .y )
346355 else :
347356 # Starcraft patch 2.1 introduced killer unit indexes
348- self .killer_unit_index = data [5 ]
349- self .killer_unit_recycle = data [6 ]
350- if self .killer_unit_index :
351- self .killer_unit_id = self .killer_unit_index << 18 | self .killer_unit_recycle
357+ self .killing_unit_index = data [5 ]
358+ self .killing_unit_recycle = data [6 ]
359+ if self .killing_unit_index :
360+ self .killing_unit_id = self .killing_unit_index << 18 | self .killing_unit_recycle
352361
353362 def __str__ (self ):
354363 return self ._str_prefix () + "{0: >15} - Unit died {1}." .format (self .unit .owner , self .unit )
0 commit comments