Healers trying to heal themselves.



  • A lot of people (me included) run into an issue where when we make a healer class where the healers purpose is to heal the closest ally to them, they often just stop functioning when they get hurt.

    Welp, it's an easy fix. The healer is just trying to heal itself which is the closest wounded thing to it, which is can't.

    SO we do this

    var target = creep.pos.findClosest(FIND_MY_CREEPS, {
    
        filter: function(object) {
    
            return (object.hits < object.hitsMax) && (object.name != creep.name);
        }
    });
    

    Basically we just tell our healer creep, that if the person he finds damaged is himself, move on to the next person.



  • Healers can now heal themselves, so this check can be removed.