Moved retroactive flag check to Character.cpp

This commit is contained in:
EmosewaMC 2022-01-19 17:34:53 -08:00
parent a9389fcabf
commit 850ae40f05
3 changed files with 15 additions and 5 deletions

View File

@ -451,6 +451,13 @@ bool Character::GetPlayerFlag(const uint32_t flagId) const {
return false; //by def, return false. return false; //by def, return false.
} }
void Character::SetRetroactiveFlags() {
// Retroactive check for if player has joined a faction to set their 'joined a faction' flag to true.
if (GetPlayerFlag(ePlayerFlags::VENTURE_FACTION) || GetPlayerFlag(ePlayerFlags::ASSEMBLY_FACTION) || GetPlayerFlag(ePlayerFlags::PARADOX_FACTION) || GetPlayerFlag(ePlayerFlags::SENTINEL_FACTION)) {
SetPlayerFlag(ePlayerFlags::JOINED_A_FACTION, true);
}
}
void Character::SaveXmlRespawnCheckpoints() void Character::SaveXmlRespawnCheckpoints()
{ {
//Export our respawn points: //Export our respawn points:

View File

@ -413,6 +413,12 @@ public:
*/ */
void SendMuteNotice() const; void SendMuteNotice() const;
/**
* Sets any flags that are meant to have been set that may not have been set due to them being
* missing in a previous patch.
*/
void SetRetroactiveFlags();
/** /**
* Get the equipped items for this character, only used for character creation * Get the equipped items for this character, only used for character creation
* @return the equipped items for this character on world load * @return the equipped items for this character on world load

View File

@ -1042,11 +1042,8 @@ void HandlePacket(Packet* packet) {
EntityManager::Instance()->ConstructAllEntities(packet->systemAddress); EntityManager::Instance()->ConstructAllEntities(packet->systemAddress);
player->GetComponent<CharacterComponent>()->SetLastRocketConfig(u""); player->GetComponent<CharacterComponent>()->SetLastRocketConfig(u"");
// Retroactive check for if player has joined a faction to set their 'joined a faction' flag to true.
if (c->GetPlayerFlag(ePlayerFlags::VENTURE_FACTION) || c->GetPlayerFlag(ePlayerFlags::ASSEMBLY_FACTION) || c->SetRetroactiveFlags();
c->GetPlayerFlag(ePlayerFlags::PARADOX_FACTION) || c->GetPlayerFlag(ePlayerFlags::SENTINEL_FACTION)) {
c->SetPlayerFlag(ePlayerFlags::JOINED_A_FACTION, true);
}
player->GetCharacter()->SetTargetScene(""); player->GetCharacter()->SetTargetScene("");