View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0006415 | Spring engine | Lua | public | 2020-08-07 14:19 | 2020-08-21 21:14 |
| Reporter | Floris | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | new | Resolution | open | ||
| Summary | 0006415: GetUnitNearestEnemy shouldnt return neutral units as well | ||||
| Description | This 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 | ||||
| Tags | No tags attached. | ||||
| Checked infolog.txt for Errors | Irrelevant | ||||
|
|
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 ``` |
|
|
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 |
|
|
seems no longer an issue, you can close this ticket |