aboutsummaryrefslogtreecommitdiff
path: root/src/game/Guild.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-27 17:39:51 -0500
committermegamage <none@none>2009-06-27 17:39:51 -0500
commitd9ec2d21969f19f0e97fe1c490fae7c0b495bfc9 (patch)
tree8e50fe975eb2813d6f160469af5e4a6dff101a6d /src/game/Guild.cpp
parent02a5c2fcc6ae1d0391ea782429574fb91c763746 (diff)
[8072] First step to get rid of data blob.
Adds new fields gender, level, xp, money, playerBytes, playerBytes2 and playerFlags to characters table. The update will not work if your database contains characters with an old data field (not fitting to the actual client version). It's recommended to backup your character database before applying this patch. --HG-- branch : trunk
Diffstat (limited to 'src/game/Guild.cpp')
-rw-r--r--src/game/Guild.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp
index 84271f08d04..c227644b0ed 100644
--- a/src/game/Guild.cpp
+++ b/src/game/Guild.cpp
@@ -369,20 +369,17 @@ bool Guild::FillPlayerData(uint64 guid, MemberSlot* memslot)
}
else
{
- QueryResult *result = CharacterDatabase.PQuery("SELECT name,data,zone,class FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
- if(!result)
- return false; // player doesn't exist
+ QueryResult *result = CharacterDatabase.PQuery("SELECT name,level,zone,class FROM characters WHERE guid = '%u'", GUID_LOPART(guid));
+ if(!result)
+ return false; // player doesn't exist
Field *fields = result->Fetch();
- plName = fields[0].GetCppString();
-
- Tokens data = StrSplit(fields[1].GetCppString(), " ");
- plLevel = Player::GetUInt32ValueFromArray(data,UNIT_FIELD_LEVEL);
-
- plZone = fields[2].GetUInt32();
- plClass = fields[3].GetUInt32();
- delete result;
+ plName = fields[0].GetCppString();
+ plLevel = fields[1].GetUInt32();
+ plZone = fields[2].GetUInt32();
+ plClass = fields[3].GetUInt32();
+ delete result;
if(plLevel<1||plLevel>STRONG_MAX_LEVEL) // can be at broken `data` field
{