mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
fix: show correct duel fled message when loser left the duel area
SMSG_DUEL_WINNER type=1 means the loser fled the duel zone rather than being defeated; was previously treated the same as a normal win. Now shows "X has fled from the duel. Y wins!" for the flee case vs the standard "X has defeated Y in a duel!" for a normal outcome.
This commit is contained in:
parent
3b499d6871
commit
38ab1e0aea
1 changed files with 8 additions and 3 deletions
|
|
@ -11996,13 +11996,18 @@ void GameHandler::handleDuelComplete(network::Packet& packet) {
|
|||
|
||||
void GameHandler::handleDuelWinner(network::Packet& packet) {
|
||||
if (packet.getSize() - packet.getReadPos() < 3) return;
|
||||
/*uint8_t type =*/ packet.readUInt8(); // 0=normal, 1=flee
|
||||
uint8_t duelType = packet.readUInt8(); // 0=normal win, 1=opponent fled duel area
|
||||
std::string winner = packet.readString();
|
||||
std::string loser = packet.readString();
|
||||
|
||||
std::string msg = winner + " has defeated " + loser + " in a duel!";
|
||||
std::string msg;
|
||||
if (duelType == 1) {
|
||||
msg = loser + " has fled from the duel. " + winner + " wins!";
|
||||
} else {
|
||||
msg = winner + " has defeated " + loser + " in a duel!";
|
||||
}
|
||||
addSystemChatMessage(msg);
|
||||
LOG_INFO("SMSG_DUEL_WINNER: winner=", winner, " loser=", loser);
|
||||
LOG_INFO("SMSG_DUEL_WINNER: winner=", winner, " loser=", loser, " type=", static_cast<int>(duelType));
|
||||
}
|
||||
|
||||
void GameHandler::toggleAfk(const std::string& message) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue