2025-07-19 21:51 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000279Spring engineGeneralpublic2007-05-30 19:48
ReporterKDR_11k 
Assigned Totvo 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000279: [patch] Dead units remain as target until Killed returns
DescriptionAny unit using Killed() to show a death animation remains as a target for all attackers until Killed() returns and the unit is destroyed. I don't think that's the intended effect, it makes death animations a bad idea for most mods.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon no-dead-targetting.patch (408 bytes) 2007-05-09 18:58 -
    Index: rts/Sim/Weapons/Weapon.cpp
    ===================================================================
    --- rts/Sim/Weapons/Weapon.cpp	(revision 3722)
    +++ rts/Sim/Weapons/Weapon.cpp	(working copy)
    @@ -534,6 +534,9 @@
     	if(unit && !(onlyTargetCategory&unit->category))
     		return false;
     
    +	if(unit && (unit->health<=0.0f))
    +		return false;
    +
     	if(weaponDef->stockpile && !numStockpiled)
     		return false;
     
    
    patch file icon no-dead-targetting.patch (408 bytes) 2007-05-09 18:58 +
  • patch file icon no-dead-and-crashing-targetting.patch (420 bytes) 2007-05-12 13:25 -
    Index: rts/Sim/Weapons/Weapon.cpp
    ===================================================================
    --- rts/Sim/Weapons/Weapon.cpp	(revision 3731)
    +++ rts/Sim/Weapons/Weapon.cpp	(working copy)
    @@ -534,6 +534,9 @@
     	if(unit && !(onlyTargetCategory&unit->category))
     		return false;
     
    +	if(unit && (unit->isDead || unit->crashing))
    +		return false;
    +
     	if(weaponDef->stockpile && !numStockpiled)
     		return false;
     
    
    patch file icon no-dead-and-crashing-targetting.patch (420 bytes) 2007-05-12 13:25 +

-Relationships
+Relationships

-Notes

~0000341

KDR_11k (reporter)

Further testing revealed that units with a death animation that self destruct remain reclaimable. Since self destruct doesn't zero the unit's HP it can be normally reclaimed (and gives the ressource boost) if the reclaimers can get the unit's HP to deplete before Killed() returns. In that case it still remains on the map, just with zero HP.

~0000905

yuritch (reporter)

Here is a patch (no-dead-targetting.patch) that (hopefully) fixes the targetting of dying units. At least in my test units stopped to fire at a target once it reached 0 health.

~0000908

yuritch (reporter)

Here is a better version of the patch (no-dead-and-crashing-targetting.patch). Now it uses isDead and crashing unit flags, so that there is no float comparisons. Also now it prevents targetting of crashing aircraft.

~0000910

tvo (reporter)

added [patch] in topic for easier filtering

~0000922

tvo (reporter)

Committed, thanks you for your contribution yuritch, and KDR_11k for filing the bug in the first place ;-)

(r3803)
+Notes

-Issue History
Date Modified Username Field Change
2006-08-25 10:46 KDR_11k New Issue
2006-08-26 21:58 KDR_11k Note Added: 0000341
2007-05-09 18:58 yuritch File Added: no-dead-targetting.patch
2007-05-09 19:00 yuritch Note Added: 0000905
2007-05-12 13:25 yuritch File Added: no-dead-and-crashing-targetting.patch
2007-05-12 13:27 yuritch Note Added: 0000908
2007-05-20 22:21 tvo Note Added: 0000910
2007-05-20 22:21 tvo Summary Dead units remain as target until Killed returns => [patch] Dead units remain as target until Killed returns
2007-05-30 19:48 tvo Status new => assigned
2007-05-30 19:48 tvo Assigned To => tvo
2007-05-30 19:48 tvo Status assigned => resolved
2007-05-30 19:48 tvo Resolution open => fixed
2007-05-30 19:48 tvo Note Added: 0000922
+Issue History