2025-07-19 12:36 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0004363Spring engineLuapublic2014-05-10 08:57
ReporterGoogle_Frog 
Assigned ToKloot 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version96.0.1+git 
Target VersionFixed in Version 
Summary0004363: 96.0.1-404 Spring.IsUnitIcon is broken
DescriptionSometimes Spring.IsUnitIcon returns true when it should not. This occurs when the camera is almost zoomed out far enough to make a unit display as an icon. As far as I can tell the callin has always been broken.

This callin is required to make a decent replacement for the default engine selection visualization. In its current state these widgets show units as deselected when they are actually selected and this is very annoying.

The callin appears to be based on distance because it is affected by hills. Whether a unit is actually an icon depends on something else. This problem occurs even on completely flat maps.
Steps To ReproduceThe easiest way to reproduce is to move the camera to just below the level at which units are shown as icons. Then spawn about 400 large units and scroll around with a selection widget enabled as they tend to use Spring.IsUnitIcon. My flat map screenshot uses armsolar on the map white with Blurry Selection Halo enabled.

This code demonstrates the problem:
function widget:Update()
    local mx, my = Spring.GetMouseState()
    local pointedType, unitID = Spring.TraceScreenRay(mx, my)
    if pointedType == 'unit' and Spring.ValidUnitID(unitID) then
        local icon = Spring.IsUnitIcon(unitID)
        WG.UnitEcho(unitID, icon and "icon" or "model")
    end
end
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • jpg file icon hill.jpg (618,399 bytes) 2014-04-18 10:05
  • jpg file icon flat.jpg (643,951 bytes) 2014-04-18 10:06
  • jpg file icon lod.jpg (537,751 bytes) 2014-04-19 04:54

-Relationships
+Relationships

-Notes

~0013022

jK (developer)

Maybe it returns true already for faricons (texture billboards)?

~0013023

Google_Frog (reporter)

After some messing around with lod I determined that it does not affect this bug. When I first tested it lod was 5x higher than my icon distance so I never saw billboards.

I just attached a lod screenshot which shows some billboard units (the light ones) as well as some models (the dark ones). The selection graphics show that Spring.IsUnitIcon goes from false to true partway through the block of units.

~0013046

Google_Frog (reporter)

This has been fixed. The ticket can be closed.

~0013048

cleanrock (reporter)

Probably fixed by
https://github.com/spring/spring/commit/c38e590
+Notes

-Issue History
Date Modified Username Field Change
2014-04-18 10:05 Google_Frog New Issue
2014-04-18 10:05 Google_Frog File Added: hill.jpg
2014-04-18 10:06 Google_Frog File Added: flat.jpg
2014-04-18 22:08 jK Note Added: 0013022
2014-04-19 04:54 Google_Frog File Added: lod.jpg
2014-04-19 04:58 Google_Frog Note Added: 0013023
2014-05-10 08:03 Google_Frog Note Added: 0013046
2014-05-10 08:57 cleanrock Note Added: 0013048
2014-05-10 08:57 cleanrock Status new => resolved
2014-05-10 08:57 cleanrock Resolution open => fixed
2014-05-10 08:57 cleanrock Assigned To => Kloot
+Issue History