diff --git a/src/combat.cc b/src/combat.cc index 56a4f52..8b51532 100644 --- a/src/combat.cc +++ b/src/combat.cc @@ -4230,6 +4230,11 @@ static int attackDetermineToHit(Object* attacker, int tile, Object* defender, in int perception = critterGetStat(attacker, STAT_PERCEPTION); + // SFALL: Fix Sharpshooter. + if (attacker == gDude) { + perception += 2 * perkGetRank(gDude, PERK_SHARPSHOOTER); + } + if (defender != NULL) { modifier = objectGetDistanceBetweenTiles(attacker, tile, defender, defender->tile); } else { @@ -4250,10 +4255,6 @@ static int attackDetermineToHit(Object* attacker, int tile, Object* defender, in modifier = -2 * perception; } - if (attacker == gDude) { - modifier -= 2 * perkGetRank(gDude, PERK_SHARPSHOOTER); - } - if (modifier >= 0) { if ((attacker->data.critter.combat.results & DAM_BLIND) != 0) { modifier *= -12;