How to get dead unit in a range?

I try to get dead units in a range by using FindUnitsInRadius(), but doesn't see this Unit Target Flags constant: "DOTA_UNIT_TARGET_FLAG_DEAD" work in this function. Could anyone tell me where i am doing wrong?

    local deadBodies = FindUnitsInRadius(caster:GetTeam(), casterLocation, nil, radius, 
        DOTA_UNIT_TARGET_TEAM_BOTH, 
        0, 
        DOTA_UNIT_TARGET_FLAG_DEAD, 0, false)

Comments

  • ZeeZee
    Posts: 4

    It work in this way but it will give me both dead and alive creeps.

        local deadBodies = FindUnitsInRadius(DOTA_UNIT_TARGET_TEAM_NONE, casterLocation, nil, radius, 
            DOTA_UNIT_TARGET_TEAM_BOTH, 
            DOTA_UNIT_TARGET_CREEP, 
            DOTA_UNIT_TARGET_FLAG_DEAD + DOTA_UNIT_TARGET_FLAG_NOT_ILLUSIONS
            , 0, false)