Open sprunk opened 2 months ago
I propose this ticket be split in two. The first ticket adding weapondDefID
as an argument in UnitDestroyed()
. After that ticket has been completed, this ticket can be implemented.
Sure. Added a bunch of tickets for each step (#1638, #1639) and added a bill of materials here in #1611.
Bill of materials to be done before starting this ticket:
1639
Reclaim can kill a unit: https://github.com/beyond-all-reason/spring/blob/19d1a003ed2b327ec0f96767bfd8cc26c5766419/rts/Sim/Units/Unit.cpp#L2054-L2058
But it's very hard to detect that this happened (when using the "drain health" method of reclaim) because the unit suddently just dies with no attacker in UnitDestroyed.
Pass the builder as the killer to
CUnit::KillUnit
. This needs to be done after the weaponDefID ticket (#1639) says this was via reclaim, since otherwise you can't distinguish it from the builder just murdering the unit (e.g. via collision damage).Do this also for other death events that have a culprit (e.g. pass transport for the "died with my transport", pass factory for the "i got cancelled" etc).
Caveats: