fix(Core/BG): store correct faction id (#10576)
This commit is contained in:
@@ -782,7 +782,7 @@ void Battleground::EndBattleground(TeamId winnerTeamId)
|
|||||||
|
|
||||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PVPSTATS_BATTLEGROUND);
|
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PVPSTATS_BATTLEGROUND);
|
||||||
stmt->SetData(0, battlegroundId);
|
stmt->SetData(0, battlegroundId);
|
||||||
stmt->SetData(1, GetWinner());
|
stmt->SetData(1, GetPvPTeamId(GetWinner()));
|
||||||
stmt->SetData(2, GetUniqueBracketId());
|
stmt->SetData(2, GetUniqueBracketId());
|
||||||
stmt->SetData(3, GetBgTypeID(true));
|
stmt->SetData(3, GetBgTypeID(true));
|
||||||
CharacterDatabase.Execute(stmt);
|
CharacterDatabase.Execute(stmt);
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
*data << uint8(1); // bg ended
|
*data << uint8(1); // bg ended
|
||||||
*data << uint8(bg->GetWinner() == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE); // who win
|
*data << uint8(GetPvPTeamId(bg->GetWinner())); // who win
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t wpos = data->wpos();
|
size_t wpos = data->wpos();
|
||||||
|
|||||||
@@ -3400,6 +3400,18 @@ enum ResponseCodes
|
|||||||
CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x67
|
CHAR_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME = 0x67
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum PvPTeamId
|
||||||
|
{
|
||||||
|
PVP_TEAM_HORDE = 0, // Battleground: Horde, Arena: Green
|
||||||
|
PVP_TEAM_ALLIANCE = 1, // Battleground: Alliance, Arena: Gold
|
||||||
|
PVP_TEAM_NEUTRAL = 2 // Battleground: Neutral, Arena: None
|
||||||
|
};
|
||||||
|
|
||||||
|
inline PvPTeamId GetPvPTeamId(TeamId teamId)
|
||||||
|
{
|
||||||
|
return teamId == TEAM_ALLIANCE ? PVP_TEAM_ALLIANCE : PVP_TEAM_HORDE;
|
||||||
|
}
|
||||||
|
|
||||||
// indexes of BattlemasterList.dbc
|
// indexes of BattlemasterList.dbc
|
||||||
enum BattlegroundTypeId
|
enum BattlegroundTypeId
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user