mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-30 08:07:46 +00:00
Fix quest reward choice.
Quest scripts need to call player.giveQuestRewards( getId(), result.param3 ) for it to work.
This commit is contained in:
parent
28d3029abe
commit
159aafadf6
1 changed files with 10 additions and 3 deletions
|
@ -1067,7 +1067,7 @@ bool Sapphire::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t opti
|
|||
|
||||
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 ) );
|
||||
}
|
||||
|
@ -1075,8 +1075,15 @@ bool Sapphire::Entity::Player::giveQuestRewards( uint32_t questId, uint32_t opti
|
|||
|
||||
if( optionalItemCount > 0 )
|
||||
{
|
||||
auto itemId = questInfo->itemReward1.at( optionalChoice );
|
||||
addItem( itemId, questInfo->itemCountReward1.at( optionalChoice ) );
|
||||
for( uint32_t i = 0; i < optionalItemCount; i++ )
|
||||
{
|
||||
auto itemId = questInfo->itemReward1.at( i );
|
||||
if( itemId == optionalChoice )
|
||||
{
|
||||
addItem( itemId, questInfo->itemCountReward1.at( i ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( gilReward > 0 )
|
||||
|
|
Loading…
Add table
Reference in a new issue