aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYour Name <you@example.com>2023-05-30 16:52:22 -0400
committerYour Name <you@example.com>2023-05-30 16:52:22 -0400
commitd428ae1c5b3b0ec88c1b55c56317c3750502d5f4 (patch)
treed3514d7473c95b972943b93ed61d5b7ad1ce127f /src
parent5937d893da5656be3f486c863ae54e08bbe66579 (diff)
downloaddmtool-d428ae1c5b3b0ec88c1b55c56317c3750502d5f4.tar.gz
dmtool-d428ae1c5b3b0ec88c1b55c56317c3750502d5f4.tar.bz2
dmtool-d428ae1c5b3b0ec88c1b55c56317c3750502d5f4.zip
Fixed bug adding damage multiple times
Diffstat (limited to 'src')
-rw-r--r--src/cmd/cmd_manipulate.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cmd/cmd_manipulate.cc b/src/cmd/cmd_manipulate.cc
index 18df098..904615b 100644
--- a/src/cmd/cmd_manipulate.cc
+++ b/src/cmd/cmd_manipulate.cc
@@ -101,8 +101,14 @@ namespace cmd {
}
auto dmg = entry::rollDmg(*w, wants2h);
text << entry::formatDmg(*w, *c1, dmg) << std::endl;
+ bool isFirst = true;
for(auto d : dmg) {
- text << " " << healOrDamageProgrammatic(p2, false, d.rolled, d.dmg_type, {});
+ int amnt = d.rolled;
+ if(isFirst) {
+ amnt += w->getDamageBonus(*c1);
+ isFirst = false;
+ }
+ text << " " << healOrDamageProgrammatic(p2, false, amnt, d.dmg_type, {});
}
} else {
text << " Miss (" << (rolled + bonus) << " to hit < " << ac << " ac)" << std::endl;