Breakout rest of the enums from dCommonVars and clean it up (#1061)

* Breakout rest of the enums from dcommonvars
so we don't have to deal with merge conflicts
ePlayerFlags is not a scoped enum, yet, due to it's complexity

* address feedback

* make player flag types consistent

* fix typo
This commit is contained in:
Aaron Kimbrell
2023-05-02 17:39:21 -05:00
committed by GitHub
parent e8590a5853
commit 6aa90ad5b2
161 changed files with 960 additions and 776 deletions

View File

@@ -20,7 +20,7 @@ void NsConcertInstrument::OnStartup(Entity* self) {
}
void NsConcertInstrument::OnRebuildNotifyState(Entity* self, eRebuildState state) {
if (state == REBUILD_RESETTING || state == REBUILD_OPEN) {
if (state == eRebuildState::RESETTING || state == eRebuildState::OPEN) {
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
}
}
@@ -96,7 +96,7 @@ void NsConcertInstrument::OnTimerDone(Entity* self, std::string name) {
if (rebuildComponent != nullptr)
rebuildComponent->ResetRebuild(false);
self->Smash(self->GetObjectID(), VIOLENT);
self->Smash(self->GetObjectID(), eKillType::VIOLENT);
self->SetVar<LWOOBJID>(u"activePlayer", LWOOBJID_EMPTY);
} else if (activePlayer != nullptr && name == "achievement") {
auto* missionComponent = activePlayer->GetComponent<MissionComponent>();
@@ -199,7 +199,7 @@ void NsConcertInstrument::EquipInstruments(Entity* self, Entity* player) {
// Equip the left hand instrument
const auto leftInstrumentLot = instrumentLotLeft.find(GetInstrumentLot(self))->second;
if (leftInstrumentLot != LOT_NULL) {
inventory->AddItem(leftInstrumentLot, 1, eLootSourceType::LOOT_SOURCE_NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false);
inventory->AddItem(leftInstrumentLot, 1, eLootSourceType::NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false);
auto* leftInstrument = inventory->FindItemByLot(leftInstrumentLot, TEMP_ITEMS);
leftInstrument->Equip();
}
@@ -207,7 +207,7 @@ void NsConcertInstrument::EquipInstruments(Entity* self, Entity* player) {
// Equip the right hand instrument
const auto rightInstrumentLot = instrumentLotRight.find(GetInstrumentLot(self))->second;
if (rightInstrumentLot != LOT_NULL) {
inventory->AddItem(rightInstrumentLot, 1, eLootSourceType::LOOT_SOURCE_NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false);
inventory->AddItem(rightInstrumentLot, 1, eLootSourceType::NONE, TEMP_ITEMS, {}, LWOOBJID_EMPTY, false);
auto* rightInstrument = inventory->FindItemByLot(rightInstrumentLot, TEMP_ITEMS);
rightInstrument->Equip();
}

View File

@@ -58,7 +58,7 @@ void NsConcertQuickBuild::OnStartup(Entity* self) {
// Destroys the quick build after a while if it wasn't built
self->AddCallbackTimer(resetActivatorTime, [self]() {
self->SetNetworkVar<float>(u"startEffect", -1.0f);
self->Smash(self->GetObjectID(), SILENT);
self->Smash(self->GetObjectID(), eKillType::SILENT);
});
}

View File

@@ -3,6 +3,7 @@
#include "MissionComponent.h"
#include "Character.h"
#include "eReplicaComponentType.h"
#include "ePlayerFlag.h"
void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID, Entity* player, int reward) {
if (missionID != 474) return;
@@ -10,7 +11,7 @@ void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID,
if (reward != LOT_NULL) {
std::vector<int> factionMissions;
int celebrationID = -1;
int flagID = -1;
int32_t flagID = -1;
if (reward == 6980) {
// Venture League
@@ -41,7 +42,7 @@ void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID,
}
if (flagID != -1) {
player->GetCharacter()->SetPlayerFlag(ePlayerFlags::JOINED_A_FACTION, true);
player->GetCharacter()->SetPlayerFlag(ePlayerFlag::JOINED_A_FACTION, true);
player->GetCharacter()->SetPlayerFlag(flagID, true);
}