diff --git a/src/ArenaReplay.cpp b/src/ArenaReplay.cpp index 3fb318c..795e408 100644 --- a/src/ArenaReplay.cpp +++ b/src/ArenaReplay.cpp @@ -163,42 +163,6 @@ class ArenaReplayArenaScript : public ArenaScript { // if isReplay then return false to exit from check condition return !isReplay; } - - /* WIP - void OnArenaStart(Battleground* bg) override - { - uint32 teamWinnerRating = 0; - uint32 teamLoserRating = 0; - uint32 teamWinnerMMR = 0; - uint32 teamLoserMMR = 0; - std::string teamWinnerName; - std::string teamLoserName; - std::string winnerGuids; - std::string loserGuids; - - for (const auto& playerPair : bg->GetPlayers()) - { - Player* player = playerPair.second; - if (player->IsSpectator()) - return; - - if (!player) - continue; - - std::string playerGuid = std::to_string(player->GetGUID().GetRawValue()); - TeamId bgTeamId = player->GetBgTeamId(); - uint32 bgInstanceId = bg->GetInstanceID(); - ArenaTeam* team = sArenaTeamMgr->GetArenaTeamById(bg->GetArenaTeamIdForTeam(bgTeamId)); - uint32 arenaTeamId = bg->GetArenaTeamIdForTeam(bgTeamId); - TeamId teamId = static_cast(arenaTeamId); - uint32 teamMMR = bg->GetArenaMatchmakerRating(teamId); - - //playerbgTeamIdMap[playerGuidCounter] = bgTeamId; - //playerArenaTeamMap[playerGuidCounter] = arenaTeamId; - //playerInstanceMap[playerGuidCounter] = bgInstanceId; - - } - }*/ }; class ArenaReplayBGScript : public BGScript @@ -639,20 +603,11 @@ class ReplayGossip : public CreatureScript // Forbidden: ', %, and , (' causes crash when using 'Replay list by player name') std::string inputCode = std::string(code); - if (inputCode.find('\'') != std::string::npos || inputCode.find('%') != std::string::npos || inputCode.find(',') != std::string::npos) - { - ChatHandler(player->GetSession()).PSendSysMessage("Invalid input."); - CloseGossipMenuFor(player); - return false; - } - - if (inputCode.length() > 50) - { - CloseGossipMenuFor(player); - return false; - } - - if (inputCode.empty()) + if (inputCode.find('\'') != std::string::npos || + inputCode.find('%') != std::string::npos || + inputCode.find(',') != std::string::npos || + inputCode.length() > 50 || + inputCode.empty()) { ChatHandler(player->GetSession()).PSendSysMessage("Invalid input."); CloseGossipMenuFor(player); @@ -833,7 +788,6 @@ class ReplayGossip : public CreatureScript //uint32 loserMMR; }; - std::string GetGossipText(ReplayInfo info) { std::string iconsTextTeam1 = GetPlayersIconTexts(info.winnerPlayerGuids); std::string iconsTextTeam2 = GetPlayersIconTexts(info.loserPlayerGuids); @@ -845,7 +799,7 @@ class ReplayGossip : public CreatureScript std::to_string(info.winnerTeamRating) + ")" + iconsTextTeam1 + "" + " '" + coloredWinnerTeamName + "'" + - "\n vs (" + std::to_string(info.loserTeamRating) + ")" + + "\n vs (" + std::to_string(info.loserTeamRating) + ")" + iconsTextTeam2 + "" + " '" + LoserTeamName + "'");