2020-10-01 04:22 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006415Spring engineLuapublic2020-08-21 21:14
ReporterFloris 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusnewResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0006415: GetUnitNearestEnemy shouldnt return neutral units as well
DescriptionThis is problematic when it returns a neutral (gaia critters) unit and renders the function useless and the solution would be one suggested in this old thread:
https://springrts.com/phpbb/viewtopic.php?f=23&t=31026

but would be cool if this function could just exclude neutral/gaia units, we only use it for AI

enemy units could still be neutral (walls) so not sure if this can become problematic there but normally gaia at least isnt an enemy
TagsNo tags attached.
Checked infolog.txt for ErrorsIrrelevant
Attached Files

-Relationships
+Relationships

-Notes

~0020511

sprung (reporter)

For Gaia:

```lua
local gaiaAlly = select(6, Spring.GetTeamInfo(Spring.GetGaiaTeamID(), false))
for allyID in pairs(Spring.GetAllyTeamList())
  if allyID ~= gaiaAlly then
    Spring.SetAlly(gaiaAlly, allyID, true)
    Spring.SetAlly(allyID, gaiaAlly, true)
  end
end
```

~0020512

sprung (reporter)

Neutral (as in Spring.SetUnitNeutral regardless of allyteam) seems like it should already be skipped: https://github.com/spring/spring/blob/4955042ba78bffd35d62ba6e23d063e7e24cd1cd/rts/Game/GameHelper.cpp#L421

~0020521

Floris (reporter)

seems no longer an issue, you can close this ticket
+Notes

-Issue History
Date Modified Username Field Change
2020-08-07 14:19 Floris New Issue
2020-08-13 22:57 sprung Note Added: 0020511
2020-08-13 23:08 sprung Note Added: 0020512
2020-08-21 21:14 Floris Note Added: 0020521
+Issue History