From b43893d560d3a07e8ff85eaff740dfd6690d1761 Mon Sep 17 00:00:00 2001 From: collett Date: Wed, 17 Jun 2020 02:19:34 +0900 Subject: [PATCH] prevent empty quest reward slot (id == 0) being added as items --- src/world/Actor/PlayerQuest.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/world/Actor/PlayerQuest.cpp b/src/world/Actor/PlayerQuest.cpp index fc1ff9ac..6eaafc91 100644 --- a/src/world/Actor/PlayerQuest.cpp +++ b/src/world/Actor/PlayerQuest.cpp @@ -1065,7 +1065,11 @@ bool Sapphire::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t opti { for( uint32_t i = 0; i < rewardItemCount; i++ ) { - addItem( questInfo->itemReward0.at( i ), questInfo->itemCountReward0.at( i ), false, false, true, true ); + auto itemId = questInfo->itemReward0.at( i ); + if( itemId > 0 ) + { + addItem( itemId, questInfo->itemCountReward0.at( i ), false, false, true, true ); + } } } @@ -1074,7 +1078,7 @@ bool Sapphire::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t opti for( uint32_t i = 0; i < optionalItemCount; i++ ) { auto itemId = questInfo->itemReward1.at( i ); - if( itemId == optionalChoice ) + if( itemId > 0 && itemId == optionalChoice ) { addItem( itemId, questInfo->itemCountReward1.at( i ), false, false, true, true ); break;