From 91d7ea5ea9204ed1a4d20d28b0d5e1b9bdca4629 Mon Sep 17 00:00:00 2001 From: WinterSolstice8 <60417494+wintersolstice8@users.noreply.github.com> Date: Tue, 21 Jan 2025 21:14:51 -0700 Subject: [PATCH] [core] [module] AH announcement module: return if item purchased --- modules/custom/cpp/ah_announcement.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/custom/cpp/ah_announcement.cpp b/modules/custom/cpp/ah_announcement.cpp index 5400daf15d1..0be99b79d7e 100644 --- a/modules/custom/cpp/ah_announcement.cpp +++ b/modules/custom/cpp/ah_announcement.cpp @@ -95,6 +95,7 @@ class AHAnnouncementModule : public CPPModule if (gil != nullptr && gil->isType(ITEM_CURRENCY) && gil->getQuantity() >= price && gil->getReserve() == 0) { + bool itemPurchasedSuccessfully = false; // clang-format off TransactionWrapper wrapper([&]() -> void { @@ -182,10 +183,17 @@ class AHAnnouncementModule : public CPPModule message::send(sellerId, std::make_unique(PChar, MESSAGE_SYSTEM_3, fmt::format("Your '{}' has sold to {} for {} gil!", name, PChar->name, price).c_str(), "")); } + + itemPurchasedSuccessfully = true; } } }); // TransactionWrapper // clang-format on + + if (itemPurchasedSuccessfully) + { + return; + } } }