From 7dd997617eaa778c880b9828032f1c94166a6d11 Mon Sep 17 00:00:00 2001 From: Triply Date: Sat, 14 Mar 2009 22:31:10 +0100 Subject: [PATCH] [7460] Fixed possible cheating in rated arena by ressurection after relog. Fix: Do not allow to remove insignia from players in arena! Fixed ending arena match when last player of team logs out. Signed-off-by: Triply --- src/game/BattleGround.cpp | 11 ++++++++--- src/game/Player.cpp | 2 +- src/shared/revision_nr.h | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp index 1d0c34ad5..2dfd9c557 100644 --- a/src/game/BattleGround.cpp +++ b/src/game/BattleGround.cpp @@ -1200,7 +1200,11 @@ void BattleGround::EventPlayerLoggedOut(Player* player) if( isBattleGround() ) EventPlayerDroppedFlag(player); else - CheckArenaWinConditions(); + { + //1 player is logging out, if it is the last, then end arena! + if( GetAlivePlayersCountByTeam(player->GetTeam()) <= 1 && GetPlayersCountByTeam(GetOtherTeam(player->GetTeam())) ) + EndBattleGround(GetOtherTeam(player->GetTeam())); + } } } @@ -1668,8 +1672,9 @@ void BattleGround::HandleKillPlayer( Player *player, Player *killer ) } } - // to be able to remove insignia - player->SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE ); + // to be able to remove insignia -- ONLY IN BattleGrounds + if( !isArena() ) + player->SetFlag( UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE ); } // return the player's team based on battlegroundplayer info diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 1dd3016e1..142bc30e0 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -4044,7 +4044,7 @@ void Player::CreateCorpse() flags |= CORPSE_FLAG_HIDE_HELM; if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK)) flags |= CORPSE_FLAG_HIDE_CLOAK; - if(InBattleGround()) + if(InBattleGround() && !InArena()) flags |= CORPSE_FLAG_LOOTABLE; // to be able to remove insignia corpse->SetUInt32Value( CORPSE_FIELD_FLAGS, flags ); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index de966162a..7a62db96d 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7459" + #define REVISION_NR "7460" #endif // __REVISION_NR_H__