katastic/openglad

Armor no longer calculated correctly

Closed this issue · 1 comments

In walker.cpp, we call get_damage_reduction but the point to target stats does not resolve and leads us to a 0 armor.

float get_damage_reduction(walker* w, float damage, walker* target)
{
    if(damage <= 0)
        return 0;

    float result = target->stats->armor/2.0f;
    if(result > damage - 1)
        return damage - 1;  // Always do at least 1 damage
    return result;
}

I submitted a fix upstream for this.