Jump to content

Recommended Posts

Posted

  • * What bug does the patch fix? What features does the patch add?
    This patch fixes a bug that causes you to stand up when a player is saved. This can interrupt drinking, eating and becomes a big nuisance with low save intervals.
    * For which repository revision was the patch created?
    7326
    * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.
    There is:
    http://getmangos.eu/community/viewtopic.php?id=6123
    * Who has been writing this patch? Please include either forum user names or email addresses.
    Just myself, SLG.

Patch:

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 0ce76b0..ff327b6 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -15591,8 +15591,7 @@ void Player::SaveToDB()
    uint32 tmp_displayid = GetDisplayId();

    // Set player sit state to standing on save, also stealth and shifted form
-    SetStandState(UNIT_STAND_STATE_STAND);                  // stand state
-    RemoveStandFlags(UNIT_STAND_FLAGS_ALL);                 // stand flags?
+    SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
    SetByteValue(UNIT_FIELD_BYTES_2, 3, 0);                 // shapeshift
    RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
    SetDisplayId(GetNativeDisplayId());

NOTE: The code shouldn't have used SetStandState() because it sends a packet to the client to stand the player up. After saving the character values to the database, UNIT_FIELD_BYTES_1 is set back to what it was originally. There should be no packets sent during save.

  • 39 years later...
Posted

The only change is in Player::SaveToDB(). UNIT_FIELD_BYTES_1 will still be set to 0 before the data values are saved, but no packet will be send with this fix, so player wont stand up.

Entering combat was not changed.

Posted
read the code, UNIT_FIELD_BYTES_1 is stored before save, and set back to the stored value after. its fine to set it to 0 there.

ah, ok, you're right... sorry, to late @ night :/

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use