2019-11-12 12:55 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006306Spring engineLuapublic2019-09-22 19:57
ReporterFLOZi 
Assigned ToKloot 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
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.

https://github.com/spring1944/spring1944/blob/master/LuaRules/Gadgets/unit_smokeshells.lua#L274

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

-Relationships
+Relationships

-Notes

~0020146

FLOZi (reporter)

Additionally;

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

~0020147

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.

+Notes

-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
+Issue History