Merge pull request #386 from EmosewaMC/passportflagnotbeingset

Added joined a faction flag
This commit is contained in:
Gie "Max" Vanommeslaeghe 2022-01-20 15:15:50 +01:00 committed by GitHub
commit e248b74ee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 0 deletions

View File

@ -451,6 +451,13 @@ bool Character::GetPlayerFlag(const uint32_t flagId) const {
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()
{
//Export our respawn points:

View File

@ -413,6 +413,12 @@ public:
*/
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
* @return the equipped items for this character on world load

View File

@ -44,6 +44,7 @@ void NsGetFactionMissionServer::OnRespondToMission(Entity* self, int missionID,
}
if (flagID != -1) {
player->GetCharacter()->SetPlayerFlag(ePlayerFlags::JOINED_A_FACTION, true);
player->GetCharacter()->SetPlayerFlag(flagID, true);
}

View File

@ -1042,6 +1042,9 @@ void HandlePacket(Packet* packet) {
EntityManager::Instance()->ConstructAllEntities(packet->systemAddress);
player->GetComponent<CharacterComponent>()->SetLastRocketConfig(u"");
c->SetRetroactiveFlags();
player->GetCharacter()->SetTargetScene("");
// Fix the destroyable component