[9252] Fixed crash in result typo in arena points loading.

Also small cleanups in PLAYER_FIELD_WATCHED_FACTION_INDEX use.
This commit is contained in:
VladimirMangos 2010-01-24 19:48:54 +03:00
parent f7b8f09bac
commit e3978a908c
4 changed files with 10 additions and 8 deletions

View file

@ -603,7 +603,7 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f); // default for players in 3.0.3
// -1 is default value
SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1));
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, -1);
SetUInt32Value(PLAYER_BYTES, (skin | (face << 8) | (hairStyle << 16) | (hairColor << 24)));
SetUInt32Value(PLAYER_BYTES_2, (facialHair | (0x00 << 8) | (0x00 << 16) | (0x02 << 24)));
@ -14628,7 +14628,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
SetUInt32Value(PLAYER_BYTES_2, fields[11].GetUInt32());
SetUInt32Value(PLAYER_BYTES_3, (fields[50].GetUInt16() & 0xFFFE) | fields[6].GetUInt8());
SetUInt32Value(PLAYER_FLAGS, fields[12].GetUInt32());
SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[49].GetUInt32());
SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fields[49].GetInt32());
SetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES, fields[48].GetUInt64());
@ -14678,7 +14679,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
_LoadArenaTeamInfo(holder->GetResult(PLAYER_LOGIN_QUERY_LOADARENAINFO));
uint32 arena_currency = GetUInt32Value(fields[40].GetUInt32());
uint32 arena_currency = fields[40].GetUInt32();
if (arena_currency > sWorld.getConfig(CONFIG_MAX_ARENA_POINTS))
arena_currency = sWorld.getConfig(CONFIG_MAX_ARENA_POINTS);
@ -16234,6 +16235,7 @@ void Player::SaveToDB()
ss << GetUInt64Value(PLAYER_FIELD_KNOWN_CURRENCIES) << ", ";
// FIXME: at this moment send to DB as unsigned, including unit32(-1)
ss << GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX) << ", ";
ss << (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE) << ", ";