cleanup enums to make them more consistent

This commit is contained in:
Aaron Kimbre
2023-01-22 17:38:47 -06:00
parent cff94b6c22
commit faf42d2f8c
133 changed files with 898 additions and 808 deletions

View File

@@ -13,6 +13,8 @@
#include "GeneralUtils.h"
#include "InventoryComponent.h"
#include "MissionComponent.h"
#include "eMissionState.h"
LootGenerator::LootGenerator() {
CDLootTableTable* lootTableTable = CDClientManager::Instance()->GetTable<CDLootTableTable>("LootTable");
@@ -186,13 +188,13 @@ std::unordered_map<LOT, int32_t> LootGenerator::RollLootMatrix(Entity* player, u
// convert faction token proxy
if (drop.itemID == 13763) {
if (missionComponent->GetMissionState(545) == MissionState::MISSION_STATE_COMPLETE)
if (missionComponent->GetMissionState(545) == eMissionState::COMPLETE)
drop.itemID = 8318; // "Assembly Token"
else if (missionComponent->GetMissionState(556) == MissionState::MISSION_STATE_COMPLETE)
else if (missionComponent->GetMissionState(556) == eMissionState::COMPLETE)
drop.itemID = 8321; // "Venture League Token"
else if (missionComponent->GetMissionState(567) == MissionState::MISSION_STATE_COMPLETE)
else if (missionComponent->GetMissionState(567) == eMissionState::COMPLETE)
drop.itemID = 8319; // "Sentinels Token"
else if (missionComponent->GetMissionState(578) == MissionState::MISSION_STATE_COMPLETE)
else if (missionComponent->GetMissionState(578) == eMissionState::COMPLETE)
drop.itemID = 8320; // "Paradox Token"
}

View File

@@ -24,6 +24,7 @@
#include "Character.h"
#include "dZoneManager.h"
#include "WorldConfig.h"
#include "eMissionTaskType.h"
void Mail::SendMail(const Entity* recipient, const std::string& subject, const std::string& body, const LOT attachment,
const uint16_t attachmentCount) {
@@ -165,7 +166,7 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd
if (!character) return;
if (character->HasPermission(PermissionMap::RestrictedMailAccess)) {
if (character->HasPermission(ePermissionMap::RestrictedMailAccess)) {
// Send a message to the player
ChatPackets::SendSystemMessage(
sysAddr,
@@ -268,7 +269,7 @@ void Mail::HandleSendMail(RakNet::BitStream* packet, const SystemAddress& sysAdd
auto* missionCompoent = entity->GetComponent<MissionComponent>();
if (missionCompoent != nullptr) {
missionCompoent->Progress(MissionTaskType::MISSION_TASK_TYPE_ITEM_COLLECTION, itemLOT, LWOOBJID_EMPTY, "", -attachmentCount);
missionCompoent->Progress(eMissionTaskType::GATHER, itemLOT, LWOOBJID_EMPTY, "", -attachmentCount);
}
}

View File

@@ -12,7 +12,7 @@
#include "LevelProgressionComponent.h"
#include "DestroyableComponent.h"
#include "GameMessages.h"
#include "eMissionState.h"
std::map<uint32_t, Precondition*> Preconditions::cache = {};
@@ -142,19 +142,19 @@ bool Precondition::CheckValue(Entity* player, const uint32_t value, bool evaluat
case PreconditionType::HasAchievement:
mission = missionComponent->GetMission(value);
return mission == nullptr || mission->GetMissionState() >= MissionState::MISSION_STATE_COMPLETE;
return mission == nullptr || mission->GetMissionState() >= eMissionState::COMPLETE;
case PreconditionType::MissionAvailable:
mission = missionComponent->GetMission(value);
return mission == nullptr || mission->GetMissionState() >= MissionState::MISSION_STATE_AVAILABLE;
return mission == nullptr || mission->GetMissionState() >= eMissionState::AVAILABLE;
case PreconditionType::OnMission:
mission = missionComponent->GetMission(value);
return mission == nullptr || mission->GetMissionState() >= MissionState::MISSION_STATE_ACTIVE;
return mission == nullptr || mission->GetMissionState() >= eMissionState::ACTIVE;
case PreconditionType::MissionComplete:
mission = missionComponent->GetMission(value);
return mission == nullptr ? false : mission->GetMissionState() >= MissionState::MISSION_STATE_COMPLETE;
return mission == nullptr ? false : mission->GetMissionState() >= eMissionState::COMPLETE;
case PreconditionType::PetDeployed:
return false; // TODO
case PreconditionType::HasFlag:

View File

@@ -72,6 +72,7 @@
#include "AMFFormat.h"
#include "MovingPlatformComponent.h"
#include "dMessageIdentifiers.h"
#include "eMissionState.h"
void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entity* entity, const SystemAddress& sysAddr) {
std::string chatCommand;
@@ -685,7 +686,7 @@ void SlashCommandHandler::HandleChatCommand(const std::u16string& command, Entit
return;
}
mission->SetMissionState(MissionState::MISSION_STATE_ACTIVE);
mission->SetMissionState(eMissionState::ACTIVE);
return;
}