From 2937852cf90e840f17a7145e7e215b4bb56c0c01 Mon Sep 17 00:00:00 2001 From: JJ <3617814+joligario@users.noreply.github.com> Date: Sat, 3 Aug 2024 20:25:07 -0400 Subject: [PATCH] [Bug Fix] Ensure close of Tribute Item search (#4439) --- zone/tribute.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 31cb0bddf..f9a9e7357 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -340,7 +340,7 @@ bool ZoneDatabase::LoadTributes() { return false; } - for (auto row = results.begin(); row != results.end(); ++row) { + for (auto &row = results.begin(); row != results.end(); ++row) { uint32 id = Strings::ToUnsignedInt(row[0]); tributeData.name = row[1]; tributeData.description = row[2]; @@ -358,7 +358,7 @@ bool ZoneDatabase::LoadTributes() { return false; } - for (auto row = results.begin(); row != results.end(); ++row) { + for (auto &row = results.begin(); row != results.end(); ++row) { uint32 id = Strings::ToUnsignedInt(row[0]); if (tribute_list.count(id) != 1) { @@ -635,11 +635,11 @@ uint32 Client::LookupTributeItemID(uint32 tribute_id, uint32 tier) if (tribute_list.contains(tribute_id)) { auto tribute = tribute_list.find(tribute_id); auto item_id = tribute->second.tiers[tier].tribute_item_id; - if (!item_id) { - return 0; + if (item_id) { + return item_id; } - return item_id; } + return 0; } /*