[8304] Move standup code to login, remove other not needed data change at save. Author: VladimirMangos
Now players saved as-is without any modifications. --HG-- branch : trunk
This commit is contained in:
@@ -854,6 +854,9 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder)
|
|||||||
sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (guid:%u)",
|
sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (guid:%u)",
|
||||||
GetAccountId(),IP_str.c_str(),pCurrChar->GetName() ,pCurrChar->GetGUIDLow());
|
GetAccountId(),IP_str.c_str(),pCurrChar->GetName() ,pCurrChar->GetGUIDLow());
|
||||||
|
|
||||||
|
if(!pCurrChar->IsStandState() && !pCurrChar->hasUnitState(UNIT_STAT_STUNNED))
|
||||||
|
pCurrChar->SetStandState(UNIT_STAND_STATE_STAND);
|
||||||
|
|
||||||
m_playerLoading = false;
|
m_playerLoading = false;
|
||||||
delete holder;
|
delete holder;
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-66
@@ -16064,23 +16064,9 @@ void Player::SaveToDB()
|
|||||||
// first save/honor gain after midnight will also update the player's honor fields
|
// first save/honor gain after midnight will also update the player's honor fields
|
||||||
UpdateHonorFields();
|
UpdateHonorFields();
|
||||||
|
|
||||||
uint32 is_save_resting = HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0;
|
|
||||||
//save, far from tavern/city
|
|
||||||
//save, but in tavern/city
|
|
||||||
sLog.outDebug("The value of player %s at save: ", m_name.c_str());
|
sLog.outDebug("The value of player %s at save: ", m_name.c_str());
|
||||||
outDebugValues();
|
outDebugValues();
|
||||||
|
|
||||||
// save state (after auras removing), if aura remove some flags then it must set it back by self)
|
|
||||||
uint32 tmp_bytes = GetUInt32Value(UNIT_FIELD_BYTES_1);
|
|
||||||
uint32 tmp_flags = GetUInt32Value(UNIT_FIELD_FLAGS);
|
|
||||||
uint32 tmp_displayid = GetDisplayId();
|
|
||||||
|
|
||||||
// Set player sit state to standing on save, also stealth and shifted form
|
|
||||||
SetByteValue(UNIT_FIELD_BYTES_1, 0, UNIT_STAND_STATE_STAND);
|
|
||||||
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
|
||||||
|
|
||||||
bool inworld = IsInWorld();
|
|
||||||
|
|
||||||
CharacterDatabase.BeginTransaction();
|
CharacterDatabase.BeginTransaction();
|
||||||
|
|
||||||
CharacterDatabase.PExecute("DELETE FROM characters WHERE guid = '%u'",GetGUIDLow());
|
CharacterDatabase.PExecute("DELETE FROM characters WHERE guid = '%u'",GetGUIDLow());
|
||||||
@@ -16137,69 +16123,48 @@ void Player::SaveToDB()
|
|||||||
|
|
||||||
ss << "', ";
|
ss << "', ";
|
||||||
|
|
||||||
ss << m_taxi; // string with TaxiMaskSize numbers
|
ss << m_taxi << ", "; // string with TaxiMaskSize numbers
|
||||||
|
|
||||||
ss << ", ";
|
ss << (IsInWorld() ? 1 : 0) << ", ";
|
||||||
ss << (inworld ? 1 : 0);
|
|
||||||
|
|
||||||
ss << ", ";
|
ss << m_cinematic << ", ";
|
||||||
ss << m_cinematic;
|
|
||||||
|
|
||||||
ss << ", ";
|
ss << m_Played_time[PLAYED_TIME_TOTAL] << ", ";
|
||||||
ss << m_Played_time[PLAYED_TIME_TOTAL];
|
ss << m_Played_time[PLAYED_TIME_LEVEL] << ", ";
|
||||||
ss << ", ";
|
|
||||||
ss << m_Played_time[PLAYED_TIME_LEVEL];
|
|
||||||
|
|
||||||
ss << ", ";
|
ss << finiteAlways(m_rest_bonus) << ", ";
|
||||||
ss << finiteAlways(m_rest_bonus);
|
ss << (uint64)time(NULL) << ", ";
|
||||||
ss << ", ";
|
ss << (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0) << ", ";
|
||||||
ss << (uint64)time(NULL);
|
//save, far from tavern/city
|
||||||
ss << ", ";
|
//save, but in tavern/city
|
||||||
ss << is_save_resting;
|
ss << m_resetTalentsCost << ", ";
|
||||||
ss << ", ";
|
ss << (uint64)m_resetTalentsTime << ", ";
|
||||||
ss << m_resetTalentsCost;
|
|
||||||
ss << ", ";
|
|
||||||
ss << (uint64)m_resetTalentsTime;
|
|
||||||
|
|
||||||
ss << ", ";
|
ss << finiteAlways(m_movementInfo.t_x) << ", ";
|
||||||
ss << finiteAlways(m_movementInfo.t_x);
|
ss << finiteAlways(m_movementInfo.t_y) << ", ";
|
||||||
ss << ", ";
|
ss << finiteAlways(m_movementInfo.t_z) << ", ";
|
||||||
ss << finiteAlways(m_movementInfo.t_y);
|
ss << finiteAlways(m_movementInfo.t_o) << ", ";
|
||||||
ss << ", ";
|
|
||||||
ss << finiteAlways(m_movementInfo.t_z);
|
|
||||||
ss << ", ";
|
|
||||||
ss << finiteAlways(m_movementInfo.t_o);
|
|
||||||
ss << ", ";
|
|
||||||
if (m_transport)
|
if (m_transport)
|
||||||
ss << m_transport->GetGUIDLow();
|
ss << m_transport->GetGUIDLow();
|
||||||
else
|
else
|
||||||
ss << "0";
|
ss << "0";
|
||||||
|
ss << ", ";
|
||||||
|
|
||||||
ss << ", ";
|
ss << m_ExtraFlags << ", ";
|
||||||
ss << m_ExtraFlags;
|
|
||||||
|
|
||||||
ss << ", ";
|
ss << uint32(m_stableSlots) << ", "; // to prevent save uint8 as char
|
||||||
ss << uint32(m_stableSlots); // to prevent save uint8 as char
|
|
||||||
|
|
||||||
ss << ", ";
|
ss << uint32(m_atLoginFlags) << ", ";
|
||||||
ss << uint32(m_atLoginFlags);
|
|
||||||
|
|
||||||
ss << ", ";
|
ss << GetZoneId() << ", ";
|
||||||
ss << GetZoneId();
|
|
||||||
|
|
||||||
ss << ", ";
|
ss << (uint64)m_deathExpireTime << ", '";
|
||||||
ss << (uint64)m_deathExpireTime;
|
|
||||||
|
|
||||||
ss << ", '";
|
ss << m_taxi.SaveTaxiDestinationsToString() << "', ";
|
||||||
ss << m_taxi.SaveTaxiDestinationsToString();
|
ss << "'0', "; // arena_pending_points
|
||||||
|
ss << GetSession()->GetLatency() << ", ";
|
||||||
ss << "', '0', ";
|
ss << GetBattleGroundId() << ", ";
|
||||||
ss << GetSession()->GetLatency();
|
ss << GetBGTeam() << ", ";
|
||||||
ss << ", ";
|
|
||||||
ss << GetBattleGroundId();
|
|
||||||
ss << ", ";
|
|
||||||
ss << GetBGTeam();
|
|
||||||
ss << ", ";
|
|
||||||
ss << m_bgEntryPoint.mapid << ", "
|
ss << m_bgEntryPoint.mapid << ", "
|
||||||
<< finiteAlways(m_bgEntryPoint.coord_x) << ", "
|
<< finiteAlways(m_bgEntryPoint.coord_x) << ", "
|
||||||
<< finiteAlways(m_bgEntryPoint.coord_y) << ", "
|
<< finiteAlways(m_bgEntryPoint.coord_y) << ", "
|
||||||
@@ -16226,10 +16191,6 @@ void Player::SaveToDB()
|
|||||||
|
|
||||||
CharacterDatabase.CommitTransaction();
|
CharacterDatabase.CommitTransaction();
|
||||||
|
|
||||||
// restore state (before aura apply, if aura remove flag then aura must set it ack by self)
|
|
||||||
SetUInt32Value(UNIT_FIELD_BYTES_1, tmp_bytes);
|
|
||||||
SetUInt32Value(UNIT_FIELD_FLAGS, tmp_flags);
|
|
||||||
|
|
||||||
// save pet (hunter pet level and experience and all type pets health/mana).
|
// save pet (hunter pet level and experience and all type pets health/mana).
|
||||||
if(Pet* pet = GetPet())
|
if(Pet* pet = GetPet())
|
||||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
||||||
|
|||||||
Reference in New Issue
Block a user