2020-08-06 09:06 CEST

View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0006306Spring engineLuapublic2020-01-06 11:53
Assigned ToKloot 
Product Version 
Target VersionFixed in Version104.0 +git 
Summary0006306: enemyID is nil in AllowUnitCloak for two script-cloaked units within min decloak distance
DescriptionWith latest s44 git (available via rapid game:s44:test)...

Smoke shells script-cloak units that cannot usually cloak.
Two script-cloaked units next to each other are not triggering enemyID in AllowUnitCloak.

'Regular' cloaking (i.e. with unitdef cloaking tags) units work correctly.
Steps To Reproduce1. Spawn gbrrifle for your team, and another for enemy team at same location, setting both to hold fire
2. Spawn a gbrtrucksupplies and gbr3inmortar together a little distance away
3. Set the mortar to fire smoke and target the riflemen
4. Observe that the debug echo shows enemyID is nil for both of them

(Debug echo gives: unitdefname, unitID, enemyID from callin, enemyID from Spring.GetUnitNearestEnemy, distance from that unit via Spring.GetUnitSeparation, and the mincloakdistance set for that unit)

You may wish to compare with regular cloaking units, gbrsniper would be a suitable testing unit. Repeat step 1 with gbrsniper and observ that they function correctly as they move in and out of decloak range.
Additional InformationIf this is some weird bug in s44 smokeshells code then I am sorry but I have hopefully investigated that and can't find why it would be.


Is the relevant gadget and the line is where the debug echo is performed.

You will probably note the lua errors in infolog at game start, these are to do with Strongpoint mode and are unrelated.
TagsNo tags attached.
Checked infolog.txt for ErrorsYes
Attached Files




FLOZi (reporter)


https://github.com/spring1944/spring1944/blob/master/LuaRules/Gadgets/unit_smokeshells.lua#L198 is where the cloak is applied, Mindecloakdistance is a constant https://github.com/spring1944/spring1944/blob/master/LuaRules/Gadgets/unit_smokeshells.lua#L14


Kloot (developer)

Last edited: 2019-09-22 19:57

View 2 revisions

The reason two enemy gbrsniper's can decloak each other (enemyID!=nil) but two gbrrifle's under smoke can not (enemyID=nil) is that the smoke gadget sets sight radius for affected units to 0, which causes a query condition to fail. This has been bypassed in 1402-ge9c4ca5.


abma (administrator)

Fix ca1557cdee3fe4075ff9d987dfe0926a229146d6 committed to develop branch: fix 0006306, repo: spring changeset id: 11602

+Related Changesets

-Issue History
Date Modified Username Field Change
2019-09-22 16:33 FLOZi New Issue
2019-09-22 18:15 FLOZi Note Added: 0020146
2019-09-22 19:56 Kloot Note Added: 0020147
2019-09-22 19:57 Kloot Note Edited: 0020147 View Revisions
2019-09-22 19:57 Kloot Assigned To => Kloot
2019-09-22 19:57 Kloot Status new => resolved
2019-09-22 19:57 Kloot Resolution open => fixed
2019-09-22 19:57 Kloot Fixed in Version => 104.0 +git
2020-01-06 11:52 Changeset attached => spring develop ca1557cd
2020-01-06 11:53 abma Note Added: 0020287
+Issue History