undo clear items

This commit is contained in:
2025-06-02 21:30:15 -05:00
parent c662477c43
commit bdf1b8a4a8
4 changed files with 36 additions and 3 deletions

View File

@@ -268,3 +268,10 @@ void cTown::set_item_taken(size_t i, bool val) {
if(i >= item_taken.size()) item_taken.resize(i + 1);
item_taken.set(i, val);
}
bool cTown::any_items() const {
for(cItem item: preset_items){
if(item.code >= 0) return true;
}
return false;
}

View File

@@ -115,6 +115,7 @@ public:
void set_up_lights();
short light_obscurity(short x,short y) const; // Obscurity function used for calculating lighting
bool is_cleaned_out() const;
bool any_items() const;
explicit cTown(cScenario& scenario, size_t dim);
void import_legacy(legacy::town_record_type& old);