Jump to content

[Patch][7340] Fix Forced Standing Up During Player Save


Auntie Mangos

Recommended Posts

  • * 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.

Link to comment
Share on other sites

  • 39 years later...
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