mercredi 20 décembre 2017

Why does the else run in this if statement?

if (finalDistance > 10) {
    dmgMulti = dmgMulti;
}

if (finalDistance < 1) {
    dmgMulti = dmgMulti + 0.5;
}

else {
    dmgMulti = dmgMulti + (0.5/finalDistance);
}

Even when finalDistance = something like 20 it still runs, is there something I'm doing horribly wrong?

Aucun commentaire:

Enregistrer un commentaire