diff --git a/src/player.cc b/src/player.cc index 52075ee..0fbace7 100644 --- a/src/player.cc +++ b/src/player.cc @@ -182,13 +182,17 @@ long_result player_base::interpret_command(level *lvl, game_command cmd) { } else if (cmd >= move_north && cmd <= move_southwest) { auto res = move(lvl, pos + MOVE[cmd - move_north]); - gold g = get_gold_at(pos, lvl->get_glist()); - gold_cnt += g.get_amount(); + gold g{{0, 0}, 0}; + int gold_tmp = 0; - if (g.get_amount()) - res.msg += "PC picked up " + std::to_string(g.get_amount()) + + while ((g = get_gold_at(pos, lvl->get_glist())).get_amount() != 0) + gold_tmp += g.get_amount(); + + if (gold_tmp) + res.msg += "PC picked up " + std::to_string(gold_tmp) + " pieces of gold. "; + if (enabled_features & FEATURE_INVENTORY) { size_t idx = get_potion_at(pos, lvl->get_plist());