Author Topic: [fixed] rev 2824 lastAttackingUnit() dos not work to get the killer  (Read 659 times)

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
softcoder replaced my lastKillerUnit() with lastAttackingUnit() to make it fitting to unitAttacking handler. But when a faster attacking unit is killed by a slower unit, the killed unit is set as lastAttackingUnit() instead of the killer.

I see 2 soloutions:
  • fix it that it could be used correct
  • use my lastKillerUnit().
« Last Edit: 19 November 2011, 00:15:06 by softcoder »

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: rev 2824 lastAttackingUnit() dos not work to get the killer
« Reply #1 on: 18 November 2011, 15:43:08 »
Ok svn now has a new set of properties to check for the killer in the unitdied event:

lastDeadUnitKillerName
lastDeadUnitKiller

These will be "" and -1 if the cause of death was not from an attacker (Attacked). To check cause of death:

lastDeadUnitCauseOfDeath

   None = 0
   Attacked = 1
   AttackBoost = 2
   StarvedResource = 3
   StarvedRegeneration =4

Thanks

MuwuM

  • Ornithopter
  • *****
  • Posts: 426
  • No Game without Move(ment)
    • View Profile
    • MuwuM - Lexicons
Re: rev 2824 lastAttackingUnit() dos not work to get the killer
« Reply #2 on: 18 November 2011, 17:34:23 »
thanks softcoder