added fallback for human gold generation upon death
This commit is contained in:
@ -14,6 +14,10 @@ const char *human::get_race_name() const {
|
|||||||
int human::dies(level *lvl) {
|
int human::dies(level *lvl) {
|
||||||
lvl->add_gold(gold{pos, GOLD_NORMAL});
|
lvl->add_gold(gold{pos, GOLD_NORMAL});
|
||||||
auto plist = lvl->get_available_around_all(pos);
|
auto plist = lvl->get_available_around_all(pos);
|
||||||
lvl->add_gold(gold{rng->get_rand_in_vector(plist), GOLD_NORMAL});
|
|
||||||
|
if (plist.size())
|
||||||
|
lvl->add_gold(gold{rng->get_rand_in_vector(plist), GOLD_NORMAL});
|
||||||
|
else
|
||||||
|
lvl->add_gold(gold{pos, GOLD_NORMAL});
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user