mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-26 14:37:44 +00:00
Merge pull request #618 from collett8192/quest_reward
Fix quest reward choice.
This commit is contained in:
commit
024b5c31b8
1 changed files with 10 additions and 3 deletions
|
@ -1063,7 +1063,7 @@ bool Sapphire::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t opti
|
||||||
|
|
||||||
if( rewardItemCount > 0 )
|
if( rewardItemCount > 0 )
|
||||||
{
|
{
|
||||||
for( uint32_t i = 0; i < questInfo->itemReward0.size(); i++ )
|
for( uint32_t i = 0; i < rewardItemCount; i++ )
|
||||||
{
|
{
|
||||||
addItem( questInfo->itemReward0.at( i ), questInfo->itemCountReward0.at( i ) );
|
addItem( questInfo->itemReward0.at( i ), questInfo->itemCountReward0.at( i ) );
|
||||||
}
|
}
|
||||||
|
@ -1071,8 +1071,15 @@ bool Sapphire::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t opti
|
||||||
|
|
||||||
if( optionalItemCount > 0 )
|
if( optionalItemCount > 0 )
|
||||||
{
|
{
|
||||||
auto itemId = questInfo->itemReward1.at( optionalChoice );
|
for( uint32_t i = 0; i < optionalItemCount; i++ )
|
||||||
addItem( itemId, questInfo->itemCountReward1.at( optionalChoice ) );
|
{
|
||||||
|
auto itemId = questInfo->itemReward1.at( i );
|
||||||
|
if( itemId == optionalChoice )
|
||||||
|
{
|
||||||
|
addItem( itemId, questInfo->itemCountReward1.at( i ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( gilReward > 0 )
|
if( gilReward > 0 )
|
||||||
|
|
Loading…
Add table
Reference in a new issue