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
if (killMe || buildProgress <= 0.0f || health <= 0.0f) {
health = 0.0f;
buildProgress = 0.0f;
KillUnit(nullptr, false, true);
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:
check whether non-nil attackerID and negative weaponDefID has a precedent. I think unit-unit collisions already do that but verify and say so in the PR.
The text was updated successfully, but these errors were encountered:
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.
Bill of materials to be done before starting this ticket:
Reclaim can kill a unit:
spring/rts/Sim/Units/Unit.cpp
Lines 2054 to 2058 in 19d1a00
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:
The text was updated successfully, but these errors were encountered: