From cba49a99522c82a84556ae441cb9a04ef4eb5987 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Fri, 17 May 2024 10:10:06 +0000 Subject: [PATCH] Fix gcc-14 build --- AI/Nullkiller/Goals/CGoal.h | 14 ++++++++------ AI/VCAI/Goals/CGoal.h | 7 ++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/AI/Nullkiller/Goals/CGoal.h b/AI/Nullkiller/Goals/CGoal.h index 9a5821eae..21d6cc863 100644 --- a/AI/Nullkiller/Goals/CGoal.h +++ b/AI/Nullkiller/Goals/CGoal.h @@ -18,10 +18,11 @@ class AIGateway; namespace Goals { - template class DLL_EXPORT CGoal : public AbstractGoal + template + class DLL_EXPORT CGoal : public AbstractGoal { public: - CGoal(EGoals goal = INVALID) : AbstractGoal(goal) + CGoal(EGoals goal = INVALID) : AbstractGoal(goal) { isAbstract = true; value = 0; @@ -32,7 +33,7 @@ namespace Goals town = nullptr; } - CGoal * clone() const override + CGoal * clone() const override { return new T(static_cast(*this)); //casting enforces template instantiation } @@ -70,15 +71,16 @@ namespace Goals } }; - template class DLL_EXPORT ElementarGoal : public CGoal, public ITask + template + class DLL_EXPORT ElementarGoal : public CGoal, public ITask { public: - ElementarGoal(EGoals goal = INVALID) : CGoal(goal), ITask() + ElementarGoal(EGoals goal = INVALID) : CGoal(goal), ITask() { AbstractGoal::isAbstract = false; } - ElementarGoal(const ElementarGoal & other) : CGoal(other), ITask(other) + ElementarGoal(const ElementarGoal & other) : CGoal(other), ITask(other) { } diff --git a/AI/VCAI/Goals/CGoal.h b/AI/VCAI/Goals/CGoal.h index f2ff5749c..b2f20dc77 100644 --- a/AI/VCAI/Goals/CGoal.h +++ b/AI/VCAI/Goals/CGoal.h @@ -18,10 +18,11 @@ class VCAI; namespace Goals { - template class DLL_EXPORT CGoal : public AbstractGoal + template + class DLL_EXPORT CGoal : public AbstractGoal { public: - CGoal(EGoals goal = INVALID) : AbstractGoal(goal) + CGoal(EGoals goal = INVALID) : AbstractGoal(goal) { priority = 0; isElementar = false; @@ -56,7 +57,7 @@ namespace Goals return f->evaluate(static_cast(*this)); //casting enforces template instantiation } - CGoal * clone() const override + CGoal * clone() const override { return new T(static_cast(*this)); //casting enforces template instantiation }