Fix crash when loading an outdoors saved game
This commit is contained in:
@@ -2152,7 +2152,8 @@ void do_load() {
|
||||
void post_load() {
|
||||
current_switch = 6;
|
||||
|
||||
reset_item_max();
|
||||
if(!is_out())
|
||||
reset_item_max();
|
||||
|
||||
if(overall_mode == MODE_OUTDOORS)
|
||||
update_explored(univ.party.p_loc);
|
||||
|
@@ -764,7 +764,7 @@ void place_glands(location where,mon_num_t m_type) {
|
||||
}
|
||||
|
||||
void reset_item_max() {
|
||||
while(univ.town.items.back().variety == eItemType::NO_ITEM)
|
||||
while(!univ.town.items.empty() && univ.town.items.back().variety == eItemType::NO_ITEM)
|
||||
univ.town.items.pop_back();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user