slight perfomance tweaks to taskDefend/enterBuilding