2025-07-18 11:46 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003841Spring engineLuapublic2013-06-12 10:01
Reporterzwzsg 
Assigned TojK 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version94.1 
Target VersionFixed in Version 
Summary0003841: AddUnitDamage broken
DescriptionSpring.AddUnitDamage does not add damage anymore.

It worked in 91, it stopped working in 94.

I have code that does:
Spring.AddUnitDamage(d.unit, d.damage, 0, d.attacker)
Spring.Echo("Adding "..d.damage.." dmg to "..d.unit.." from "..d.attacker)

I checked the parameters: http://cpc.cx/7xU
As you see from tooltip, the red pointer got zero damage.
Steps To ReproduceIf Spring.AddUnitDamage is triggered by gadget:UnitPreDamaged, don't forget to work around gadget:UnitPreDamaged compatibility break first.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0010857

zwzsg (reporter)

Other picture with the tooltip not cropped this time so you can see the pointer (26923) is healthy despite receiving AddUnitDamage: http://cpc.cx/7xV

~0010858

abma (administrator)

infolog.txt would answer many questions (engine version used, possible lua errors, game used, ...)

~0010859

zwzsg (reporter)

Last edited: 2013-06-12 05:14

View 2 revisions

I do not see how the infolog would help, but it's easier to give one than to argue, so: http://pastebin.ca/2396206

Kernel Panic 4.44 is Kernel Panic 4.4 with a few fixes, in particular the gadget:UnitPreDamaged parameter change, do you also need it? Maybe you need a demo file too? Or a specifically made tiny test mod showcasing the problem?

~0010860

user744

my "mining gadget" also seems to be broken by this.
I tried to figure out the problem but did not manage.
(the gadget/game is too bloated so did not bother to make mantis. will see if can provide a simpler example...)

~0010861

zwzsg (reporter)

Last edited: 2013-06-12 05:16

View 2 revisions

Here, I added a super simple test mod showcasing the problem:
http://springrts.com/mantis/file_download.php?file_id=2313&type=bug

Contains a gadget that do:
    function gadget:GameFrame()
        for _,u in ipairs(Spring.GetAllUnits()) do
            Spring.AddUnitDamage(u,1,0)
        end
    end

In Spring 91, the health of the start unit rapidly decrease.
In Spring 94, the health of the start unit does not change.

This game file is 300kb, the effect appears the as soon as the game starts, not even any ingame action is required to trigger it, the game is super simple so side-effects can be ruled out, hopefully that is enough?

+Notes

-Issue History
Date Modified Username Field Change
2013-06-12 03:53 zwzsg New Issue
2013-06-12 04:03 zwzsg Note Added: 0010857
2013-06-12 04:24 abma Note Added: 0010858
2013-06-12 04:49 zwzsg Note Added: 0010859
2013-06-12 04:53 user744 Note Added: 0010860
2013-06-12 05:09 zwzsg Note Added: 0010861
2013-06-12 05:14 zwzsg Note Edited: 0010859 View Revisions
2013-06-12 05:15 zwzsg File Added: AddUnitDamage.sd7
2013-06-12 05:16 zwzsg Note Edited: 0010861 View Revisions
2013-06-12 10:01 jK Changeset attached => spring develop 98b61e01
2013-06-12 10:01 jK Assigned To => jK
2013-06-12 10:01 jK Status new => resolved
2013-06-12 10:01 jK Resolution open => fixed
+Issue History