undo/redo edit placed item
This commit is contained in:
@@ -276,4 +276,15 @@ bool cTown::any_preset_items() const {
|
||||
if(item.code >= 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool cTown::cItem::operator==(const cTown::cItem& other) {
|
||||
CHECK_EQ(other, loc);
|
||||
CHECK_EQ(other, code);
|
||||
CHECK_EQ(other, ability);
|
||||
CHECK_EQ(other, charges);
|
||||
CHECK_EQ(other, always_there);
|
||||
CHECK_EQ(other, property);
|
||||
CHECK_EQ(other, contained);
|
||||
return true;
|
||||
}
|
@@ -59,6 +59,9 @@ public:
|
||||
eEnchant ability;
|
||||
int charges = -1;
|
||||
bool always_there = false, property = false, contained = false;
|
||||
// For detecting actual changes to town items in the editor
|
||||
bool operator==(const cItem& other);
|
||||
bool operator!=(const cItem& other) { return !(*this == other); }
|
||||
|
||||
void import_legacy(legacy::preset_item_type old);
|
||||
cItem();
|
||||
|
Reference in New Issue
Block a user