Skip to content

Instantly share code, notes, and snippets.

@fredimachado
Created August 19, 2011 02:32
Show Gist options
  • Save fredimachado/1155894 to your computer and use it in GitHub Desktop.
Save fredimachado/1155894 to your computer and use it in GitHub Desktop.
Update realmcharacters table after deleting a char
diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
index c022d81..2afcd86 100755
--- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp
@@ -752,6 +752,8 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
Player::DeleteFromDB(guid, GetAccountId());
+ LoginDatabase.PExecute("UPDATE realmcharacters SET numchars = numchars - 1 WHERE acctid = '%d' AND realmid = '%d'", GetAccountId(), realmID);
+
WorldPacket data(SMSG_CHAR_DELETE, 1);
data << (uint8)CHAR_DELETE_SUCCESS;
SendPacket(&data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment