2025-07-22 14:27 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003987Spring engineGeneralpublic2013-09-01 17:03
Reportersilentwings 
Assigned ToKloot 
PriorityhighSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version94.1.1+git 
Target VersionFixed in Version94.1.1+git 
Summary0003987: units seem to be given new unitIDs whenever they do damage in 94.1.1-1077
Descriptionwhen units do damage they are apparently given a new unitID - i'm inferring this from the attackerID reported by UnitDamaged.

coms attacking smth always returns attackerID -1, all other units i tested get a new ID each time and that just counts up from 0.

i can't quite believe i haven't gone mad :S

Steps To Reproduceuse this gadget in a .sdd of ba 7.81 (or any other mod) with 94.1.1-1077. spawn smth and attack smth. watch the attackerID (echoed) just count up from 0, except if you use a com in which case it's always -1.

function gadget:GetInfo()
    return {
        name = "UnitDamagedInfo",
        desc = "",
        author = "Bluestone",
        date = "",
        license = "",
        layer = 0,
        enabled = true -- loaded by default?
    }
end

if not gadgetHandler:IsSyncedCode() then
    return false
end



function gadget:UnitDamaged(unitID, unitDefID, unitTeam, damage, paralyzer, weaponDefID, attackerID, attackerDefID, attackerTeam)
    Spring.Echo("UnitDamaged is " .. unitID .. " by " .. attackerID)
end

TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0011521

Kloot (developer)

you are missing the projectileID argument after weaponDefID

~0011522

silentwings (reporter)

Oh, you are completely right.

Sorry to be a nuisance with reopening, but the extra argument is missing in the basecontent gadget handler and this means attackerTeam (the final argument) will always return nil.

~0011523

Kloot (developer)

Just noticed that, thanks.
+Notes

-Issue History
Date Modified Username Field Change
2013-09-01 16:27 silentwings New Issue
2013-09-01 16:35 Kloot Note Added: 0011521
2013-09-01 16:36 Kloot Status new => closed
2013-09-01 16:36 Kloot Assigned To => Kloot
2013-09-01 16:36 Kloot Resolution open => no change required
2013-09-01 17:02 silentwings Note Added: 0011522
2013-09-01 17:02 silentwings Status closed => feedback
2013-09-01 17:02 silentwings Resolution no change required => reopened
2013-09-01 17:03 Kloot Note Added: 0011523
2013-09-01 17:03 Kloot Status feedback => resolved
2013-09-01 17:03 Kloot Fixed in Version => 94.1.1+git
2013-09-01 17:03 Kloot Resolution reopened => fixed
+Issue History