Mindustry icon indicating copy to clipboard operation
Mindustry copied to clipboard

Added unit index to radar statement

Open SingularityT3 opened this issue 2 years ago • 0 comments

The radar statement now returns a unit based on the index after sorting. For example, when index is 0(and sort is distance and sortOrder is 1), the closest unit is returned. When the index is 1, the second closest unit is returned and so on. If the index is higher than the number of units nearby, the result is null.

Demo program: logic demo

If your pull request is not translation or serverlist-related, read the list of requirements below and check each box:

  • [X] I have read the contribution guidelines.
  • [X] I have ensured that my code compiles, if applicable.
  • [X] I have ensured that any new features in this PR function correctly in-game, if applicable.

SingularityT3 avatar Sep 18 '21 08:09 SingularityT3