fixed issue with player not being able to pick up multiple piles of gold on the same tile
This commit is contained in:
@ -182,13 +182,17 @@ long_result player_base::interpret_command(level *lvl, game_command cmd) {
|
|||||||
} else if (cmd >= move_north && cmd <= move_southwest) {
|
} else if (cmd >= move_north && cmd <= move_southwest) {
|
||||||
auto res = move(lvl, pos + MOVE[cmd - move_north]);
|
auto res = move(lvl, pos + MOVE[cmd - move_north]);
|
||||||
|
|
||||||
gold g = get_gold_at(pos, lvl->get_glist());
|
gold g{{0, 0}, 0};
|
||||||
gold_cnt += g.get_amount();
|
int gold_tmp = 0;
|
||||||
|
|
||||||
if (g.get_amount())
|
while ((g = get_gold_at(pos, lvl->get_glist())).get_amount() != 0)
|
||||||
res.msg += "PC picked up " + std::to_string(g.get_amount()) +
|
gold_tmp += g.get_amount();
|
||||||
|
|
||||||
|
if (gold_tmp)
|
||||||
|
res.msg += "PC picked up " + std::to_string(gold_tmp) +
|
||||||
" pieces of gold. ";
|
" pieces of gold. ";
|
||||||
|
|
||||||
|
|
||||||
if (enabled_features & FEATURE_INVENTORY) {
|
if (enabled_features & FEATURE_INVENTORY) {
|
||||||
size_t idx = get_potion_at(pos, lvl->get_plist());
|
size_t idx = get_potion_at(pos, lvl->get_plist());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user