fix(Core/CharacterHandler): Reputation + Map Explore AT_FIRST_LOGIN (#9252)

This commit is contained in:
IntelligentQuantum
2021-11-29 02:53:25 +03:30
committed by GitHub
parent 9357032c25
commit 0632f3baff
2 changed files with 36 additions and 30 deletions
@@ -582,13 +582,6 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
SetHonorPoints(sWorld->getIntConfig(CONFIG_START_HONOR_POINTS)); SetHonorPoints(sWorld->getIntConfig(CONFIG_START_HONOR_POINTS));
SetArenaPoints(sWorld->getIntConfig(CONFIG_START_ARENA_POINTS)); SetArenaPoints(sWorld->getIntConfig(CONFIG_START_ARENA_POINTS));
// start with every map explored
if (sWorld->getBoolConfig(CONFIG_START_ALL_EXPLORED))
{
for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; i++)
SetFlag(PLAYER_EXPLORED_ZONES_1 + i, 0xFFFFFFFF);
}
// Played time // Played time
m_Last_tick = time(nullptr); m_Last_tick = time(nullptr);
m_Played_time[PLAYED_TIME_TOTAL] = 0; m_Played_time[PLAYED_TIME_TOTAL] = 0;
@@ -983,6 +983,18 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
pCurrChar->CheckAllAchievementCriteria(); pCurrChar->CheckAllAchievementCriteria();
} }
bool firstLogin = pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST);
if (firstLogin)
{
pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST);
// start with every map explored
if (sWorld->getBoolConfig(CONFIG_START_ALL_EXPLORED))
{
for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; i++)
pCurrChar->SetFlag(PLAYER_EXPLORED_ZONES_1 + i, 0xFFFFFFFF);
}
// Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way // Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way
if (sWorld->getBoolConfig(CONFIG_START_ALL_REP)) if (sWorld->getBoolConfig(CONFIG_START_ALL_REP))
{ {
@@ -1012,6 +1024,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
repMgr.SendStates(); repMgr.SendStates();
} }
}
// show time before shutdown if shutdown planned. // show time before shutdown if shutdown planned.
if (sWorld->IsShuttingDown()) if (sWorld->IsShuttingDown())