rP17623 fixing #3215 was broken and messy:
- Broken: GetNonGaiaEntities returns entities by Gaia (reported in #4495, fix at D164, found out on the polar sea map D156 where gaia wolves look for non-gaia targets but loop over gaia too causing lag) The ownership mask was taken without further examination (only playtest) from an irc recommendation on 2015-06-03-QuakeNet-#0ad-dev.log (17:31 to 17:57).
- Messy: a) Bad code location: There is code in ScriptFunctions.cpp that should have been in Selection.cpp. b) Bad loop: Querying the rangemanage for entities owned by each player consecutively and then concatenating the results instead of doing one query to get all non-gaia entities. As a result we can get rid of that playermanager reference again. c) Bad alias: A script function calls another script function, while every script function should just call one entity selection function and be done with it. d) Bad virtual keywords as pointed out in lepers quick-review wave on 2016-01-10-QuakeNet-#0ad-dev.log removed in rP17663
Lame excuse: 7 months of begging and still not getting a complete review.
This patch proposes to fix the messy code, as the broken part is fixed in the other proposal.