mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-22 13:37:22 +00:00
Refactored if statement for coins
Refactored the if statement for coins so there is only one SetCoins call for the function.
This commit is contained in:
parent
6aad799f95
commit
e84811bdce
@ -453,7 +453,7 @@ void Mission::YieldRewards() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (info->reward_currency_repeatable > 0) {
|
if (info->reward_currency_repeatable > 0) {
|
||||||
character->SetCoins(character->GetCoins() + info->reward_currency_repeatable, COIN_SOURCE_MISSION);
|
character->SetCoins(character->GetCoins() + info->reward_currency_repeatable, LOOT_SOURCE_MISSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -481,10 +481,14 @@ void Mission::YieldRewards() {
|
|||||||
inventoryComponent->AddItem(pair.first, count);
|
inventoryComponent->AddItem(pair.first, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->reward_currency > 0 && info->isMission) {
|
int32_t lootSource = LOOT_SOURCE_NONE;
|
||||||
character->SetCoins(character->GetCoins() + info->reward_currency, COIN_SOURCE_MISSION);
|
if (info->reward_currency > 0) {
|
||||||
} else if (info->reward_currency && !info->isMission) {
|
if(info->isMission) {
|
||||||
character->SetCoins(character->GetCoins() + info->reward_currency, COIN_SOURCE_ACHIEVEMENT);
|
lootSource = LOOT_SOURCE_MISSION;
|
||||||
|
} else {
|
||||||
|
lootSource = LOOT_SOURCE_ACHIEVEMENT;
|
||||||
|
}
|
||||||
|
character->SetCoins(character->GetCoins() + info->reward_currency, lootSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info->reward_maxinventory > 0) {
|
if (info->reward_maxinventory > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user