From 560923fc1f219c3b8d87a2925b00d10a6f6fb161 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Wed, 15 May 2024 12:50:51 +0200 Subject: [PATCH] show cheating problem message only once per AI --- AI/Nullkiller/AIGateway.cpp | 7 ++++++- AI/Nullkiller/AIGateway.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/AI/Nullkiller/AIGateway.cpp b/AI/Nullkiller/AIGateway.cpp index 53d13fabb..559eaf6bb 100644 --- a/AI/Nullkiller/AIGateway.cpp +++ b/AI/Nullkiller/AIGateway.cpp @@ -77,6 +77,7 @@ AIGateway::AIGateway() destinationTeleport = ObjectInstanceID(); destinationTeleportPos = int3(-1); nullkiller.reset(new Nullkiller()); + announcedCheatingProblem = false; } AIGateway::~AIGateway() @@ -831,7 +832,11 @@ void AIGateway::makeTurn() if(cb->getStartInfo()->extraOptionsInfo.cheatsAllowed) cb->sendMessage("vcmieagles"); else - cb->sendMessage("Nullkiller AI currently requires the ability to cheat in order to function correctly! Please enable!"); + { + if(!announcedCheatingProblem) + cb->sendMessage("Nullkiller AI currently requires the ability to cheat in order to function correctly! Please enable!"); + announcedCheatingProblem = true; + } retrieveVisitableObjs(); diff --git a/AI/Nullkiller/AIGateway.h b/AI/Nullkiller/AIGateway.h index 2c157d0a0..00f1b7c2e 100644 --- a/AI/Nullkiller/AIGateway.h +++ b/AI/Nullkiller/AIGateway.h @@ -96,6 +96,7 @@ public: std::unique_ptr makingTurn; private: boost::mutex turnInterruptionMutex; + bool announcedCheatingProblem; public: ObjectInstanceID selectedObject;