Allow ulocate to output enemy buildings (#6704)
* Allow ulocate to output enemy buildings Previously you would have to use ucontrol getblock to get the actual Building that's weird and just confuses newbs like me * whoops, turns out ulocate doesn't have a range * c o d e s t y l e * Always return building object if on same team
This commit is contained in:
@@ -322,7 +322,14 @@ public class LExecutor{
|
|||||||
cache.found = false;
|
cache.found = false;
|
||||||
exec.setnum(outFound, 0);
|
exec.setnum(outFound, 0);
|
||||||
}
|
}
|
||||||
exec.setobj(outBuild, res != null && res.build != null && res.build.team == exec.team ? cache.build = res.build : null);
|
|
||||||
|
if(res != null && res.build != null &&
|
||||||
|
(unit.within(res.build.x, res.build.y, Math.max(unit.range(), buildingRange)) || res.build.team == exec.team)){
|
||||||
|
cache.build = res.build;
|
||||||
|
exec.setobj(outBuild, res.build);
|
||||||
|
}else{
|
||||||
|
exec.setobj(outBuild, null);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
exec.setobj(outBuild, cache.build);
|
exec.setobj(outBuild, cache.build);
|
||||||
exec.setbool(outFound, cache.found);
|
exec.setbool(outFound, cache.found);
|
||||||
|
|||||||
Reference in New Issue
Block a user