From e455f66e865a79bc4c069d8e6b2ce1b0791b4c95 Mon Sep 17 00:00:00 2001 From: nordsoft Date: Mon, 5 Sep 2022 11:38:09 +0400 Subject: [PATCH] [810] Fix bonus duplication --- lib/HeroBonus.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/HeroBonus.cpp b/lib/HeroBonus.cpp index 50eaf021f..7218e23ae 100644 --- a/lib/HeroBonus.cpp +++ b/lib/HeroBonus.cpp @@ -957,7 +957,10 @@ void CBonusSystemNode::getAllBonusesRec(BonusList &out) const auto updated = b->updater ? getUpdatedBonus(b, b->updater) : b; - out.push_back(updated); + + //do not add bonus with same pointer + if(!vstd::contains(out, updated)) + out.push_back(updated); } }