# AIFilterGathering
Flags —
Native
# Arguments
unitgroup
— groupint
— inResourcefixed
— distance
Returns — unitgroup
native unitgroup AIFilterGathering(
unitgroup group,
int inResource,
fixed distance,
);
# Related
Category: Unclassified
# Examples
mods/core.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:1024
// Find only scv's that are gathering minerals and are close to their mineral target.
targetGroup = AIFilterGathering(targetGroup, c_resourceTypeMinerals, c_maxDistanceToMinerals);
scanCount = UnitGroupCount(targetGroup, c_unitCountAll);
while (scanCount > 0) {
mods/starcoop/starcoop.sc2mod — base.sc2data/TriggerLibs/Tactical/TactTerrAI.galaxy:985
// Find only scv's that are gathering minerals and are close to their mineral target.
targetGroup = AIFilterGathering(targetGroup, c_resourceTypeMinerals, c_maxDistanceToMinerals);
scanCount = UnitGroupCount(targetGroup, c_unitCountAll);
while (scanCount > 0) {