mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[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:
parent
f7b8f09bac
commit
e3978a908c
4 changed files with 10 additions and 8 deletions
|
|
@ -876,9 +876,9 @@ void WorldSession::HandleTutorialReset( WorldPacket & /*recv_data*/ )
|
||||||
void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data)
|
void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket & recv_data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG("WORLD: Received CMSG_SET_WATCHED_FACTION");
|
DEBUG_LOG("WORLD: Received CMSG_SET_WATCHED_FACTION");
|
||||||
uint32 fact;
|
int32 repId;
|
||||||
recv_data >> fact;
|
recv_data >> repId;
|
||||||
GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fact);
|
GetPlayer()->SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, repId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data)
|
void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recv_data)
|
||||||
|
|
|
||||||
|
|
@ -4373,7 +4373,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player)
|
||||||
player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
player->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
||||||
|
|
||||||
//-1 is default value
|
//-1 is default value
|
||||||
player->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, uint32(-1));
|
player->SetInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, -1);
|
||||||
|
|
||||||
//player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000 );
|
//player->SetUInt32Value(PLAYER_FIELD_BYTES, 0xEEE00000 );
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -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
|
SetFloatValue(UNIT_FIELD_HOVERHEIGHT, 1.0f); // default for players in 3.0.3
|
||||||
|
|
||||||
// -1 is default value
|
// -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, (skin | (face << 8) | (hairStyle << 16) | (hairColor << 24)));
|
||||||
SetUInt32Value(PLAYER_BYTES_2, (facialHair | (0x00 << 8) | (0x00 << 16) | (0x02 << 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_2, fields[11].GetUInt32());
|
||||||
SetUInt32Value(PLAYER_BYTES_3, (fields[50].GetUInt16() & 0xFFFE) | fields[6].GetUInt8());
|
SetUInt32Value(PLAYER_BYTES_3, (fields[50].GetUInt16() & 0xFFFE) | fields[6].GetUInt8());
|
||||||
SetUInt32Value(PLAYER_FLAGS, fields[12].GetUInt32());
|
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());
|
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));
|
_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))
|
if (arena_currency > sWorld.getConfig(CONFIG_MAX_ARENA_POINTS))
|
||||||
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) << ", ";
|
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 << GetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX) << ", ";
|
||||||
|
|
||||||
ss << (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE) << ", ";
|
ss << (uint16)(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFE) << ", ";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9251"
|
#define REVISION_NR "9252"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue