From 4af2d917c0439b97e97c15c08a842f7ed3f8a959 Mon Sep 17 00:00:00 2001 From: nordsoft Date: Fri, 15 Sep 2023 21:13:07 +0200 Subject: [PATCH] Fix messages for pandoras --- lib/mapObjects/CGPandoraBox.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/mapObjects/CGPandoraBox.cpp b/lib/mapObjects/CGPandoraBox.cpp index fc87a763c..d6b9503be 100644 --- a/lib/mapObjects/CGPandoraBox.cpp +++ b/lib/mapObjects/CGPandoraBox.cpp @@ -45,6 +45,7 @@ void CGPandoraBox::onHeroVisit(const CGHeroInstance * h) const { auto setText = [](MetaString & text, int tId, const CGHeroInstance * h) { + text.clear(); text.appendLocalString(EMetaText::ADVOB_TXT, tId); text.replaceRawString(h->getNameTranslated()); }; @@ -179,6 +180,7 @@ void CGPandoraBox::serializeJsonOptions(JsonSerializeFormat & handler) configuration.info.emplace_back(); configuration.info.back().visitType = Rewardable::EEventType::EVENT_FIRST_VISIT; configuration.info.back().reward = reward; + reward = Rewardable::Reward{}; } };