Eliminate WorldConfig Magic Numbers

Add comments for fields

Use the name directly
This commit is contained in:
EmosewaMC
2023-01-01 04:51:22 -08:00
parent 09157506bf
commit 19be0a61b2
6 changed files with 177 additions and 47 deletions

View File

@@ -18,6 +18,7 @@
#include "dZoneManager.h"
#include "InventoryComponent.h"
#include "Database.h"
#include "WorldConfig.h"
Mission::Mission(MissionComponent* missionComponent, const uint32_t missionId) {
m_MissionComponent = missionComponent;
@@ -435,9 +436,9 @@ void Mission::YieldRewards() {
int32_t coinsToSend = 0;
if (info->LegoScore > 0) {
eLootSourceType lootSource = info->isMission ? eLootSourceType::LOOT_SOURCE_MISSION : eLootSourceType::LOOT_SOURCE_ACHIEVEMENT;
if (levelComponent->GetLevel() >= dZoneManager::Instance()->GetMaxLevel()) {
if (levelComponent->GetLevel() >= dZoneManager::Instance()->GetWorldConfig()->levelCap) {
// Since the character is at the level cap we reward them with coins instead of UScore.
coinsToSend += info->LegoScore * dZoneManager::Instance()->GetLevelCapCurrencyConversion();
coinsToSend += info->LegoScore * dZoneManager::Instance()->GetWorldConfig()->levelCapCurrencyConversion;
} else {
characterComponent->SetUScore(characterComponent->GetUScore() + info->LegoScore);
GameMessages::SendModifyLEGOScore(entity, entity->GetSystemAddress(), info->LegoScore, lootSource);