diff options
author | megamage <none@none> | 2009-08-05 16:03:33 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-05 16:03:33 -0500 |
commit | 47e36000cb85e63c809c9e256554f3b39f574756 (patch) | |
tree | b2621197d9975a36dc2a4d815d6d705efe239d45 /src | |
parent | 743233a0576a05f0928e6e5acccabe8ebc0acbd0 (diff) |
[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
Diffstat (limited to 'src')
-rw-r--r-- | src/game/CharacterHandler.cpp | 3 | ||||
-rw-r--r-- | src/game/Player.cpp | 91 |
2 files changed, 29 insertions, 65 deletions
diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index 2f9c590c0d0..056bcd816e0 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -854,6 +854,9 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) sLog.outChar("Account: %d (IP: %s) Login Character:[%s] (guid:%u)", 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; delete holder; } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index f96c718d6a9..b5c50336369 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -16064,23 +16064,9 @@ void Player::SaveToDB() // first save/honor gain after midnight will also update the player's honor fields 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()); 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.PExecute("DELETE FROM characters WHERE guid = '%u'",GetGUIDLow()); @@ -16137,69 +16123,48 @@ void Player::SaveToDB() ss << "', "; - ss << m_taxi; // string with TaxiMaskSize numbers + ss << m_taxi << ", "; // string with TaxiMaskSize numbers - ss << ", "; - ss << (inworld ? 1 : 0); + ss << (IsInWorld() ? 1 : 0) << ", "; - ss << ", "; - ss << m_cinematic; + ss << m_cinematic << ", "; - ss << ", "; - ss << m_Played_time[PLAYED_TIME_TOTAL]; - ss << ", "; - ss << m_Played_time[PLAYED_TIME_LEVEL]; + ss << m_Played_time[PLAYED_TIME_TOTAL] << ", "; + ss << m_Played_time[PLAYED_TIME_LEVEL] << ", "; - ss << ", "; - ss << finiteAlways(m_rest_bonus); - ss << ", "; - ss << (uint64)time(NULL); - ss << ", "; - ss << is_save_resting; - ss << ", "; - ss << m_resetTalentsCost; - ss << ", "; - ss << (uint64)m_resetTalentsTime; + ss << finiteAlways(m_rest_bonus) << ", "; + ss << (uint64)time(NULL) << ", "; + ss << (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) ? 1 : 0) << ", "; + //save, far from tavern/city + //save, but in tavern/city + ss << m_resetTalentsCost << ", "; + ss << (uint64)m_resetTalentsTime << ", "; - ss << ", "; - ss << finiteAlways(m_movementInfo.t_x); - ss << ", "; - ss << finiteAlways(m_movementInfo.t_y); - ss << ", "; - ss << finiteAlways(m_movementInfo.t_z); - ss << ", "; - ss << finiteAlways(m_movementInfo.t_o); - ss << ", "; + ss << finiteAlways(m_movementInfo.t_x) << ", "; + ss << finiteAlways(m_movementInfo.t_y) << ", "; + ss << finiteAlways(m_movementInfo.t_z) << ", "; + ss << finiteAlways(m_movementInfo.t_o) << ", "; if (m_transport) ss << m_transport->GetGUIDLow(); else ss << "0"; - ss << ", "; - ss << m_ExtraFlags; - ss << ", "; - ss << uint32(m_stableSlots); // to prevent save uint8 as char + ss << m_ExtraFlags << ", "; - ss << ", "; - ss << uint32(m_atLoginFlags); + ss << uint32(m_stableSlots) << ", "; // to prevent save uint8 as char - ss << ", "; - ss << GetZoneId(); + ss << uint32(m_atLoginFlags) << ", "; - ss << ", "; - ss << (uint64)m_deathExpireTime; + ss << GetZoneId() << ", "; - ss << ", '"; - ss << m_taxi.SaveTaxiDestinationsToString(); + ss << (uint64)m_deathExpireTime << ", '"; - ss << "', '0', "; - ss << GetSession()->GetLatency(); - ss << ", "; - ss << GetBattleGroundId(); - ss << ", "; - ss << GetBGTeam(); - ss << ", "; + ss << m_taxi.SaveTaxiDestinationsToString() << "', "; + ss << "'0', "; // arena_pending_points + ss << GetSession()->GetLatency() << ", "; + ss << GetBattleGroundId() << ", "; + ss << GetBGTeam() << ", "; ss << m_bgEntryPoint.mapid << ", " << finiteAlways(m_bgEntryPoint.coord_x) << ", " << finiteAlways(m_bgEntryPoint.coord_y) << ", " @@ -16226,10 +16191,6 @@ void Player::SaveToDB() 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). if(Pet* pet = GetPet()) pet->SavePetToDB(PET_SAVE_AS_CURRENT); |