2021-06-13 05:00 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006415Spring engineLuapublic2020-08-21 21:14
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
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:

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




sprung (reporter)

For Gaia:

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)


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


Floris (reporter)

seems no longer an issue, you can close this ticket

-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