From 472f80896afebcc8bdde79ae624025bff20c28a0 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sat, 14 Jun 2025 11:48:40 -0500 Subject: [PATCH] fix inheritance of undo()/redo() in cTerrainAction --- src/scenedit/scen.undo.hpp | 6 ++---- src/tools/undo.hpp | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/scenedit/scen.undo.hpp b/src/scenedit/scen.undo.hpp index 080c697c..2d09c63b 100644 --- a/src/scenedit/scen.undo.hpp +++ b/src/scenedit/scen.undo.hpp @@ -41,10 +41,8 @@ public: cTerrainAction(std::string name, location out_sec, location where, bool reversed = false); // Construct cTerrainAction in the current town/outdoor section cTerrainAction(std::string name, location where, bool reversed = false); - void undo(); - void redo(); - bool undo_me() = 0; - bool redo_me() = 0; + void undo() override; + void redo() override; private: /// Show where the change happened void showChangeSite(); diff --git a/src/tools/undo.hpp b/src/tools/undo.hpp index b2e51350..6a1c5330 100644 --- a/src/tools/undo.hpp +++ b/src/tools/undo.hpp @@ -29,10 +29,10 @@ protected: public: /// Undoes this action if it has not already been undone. /// If it has already been undone, does nothing. - void undo(); + virtual void undo(); /// Redoes this action if it has been undone. /// If it has not been undone, does nothing. - void redo(); + virtual void redo(); /// Cchecks to see whether the action has been undone. /// @return false if it the action has been undone. bool isDone() {return done;};