Jump to content

Fix battleground exploit


amaru
 Share

Recommended Posts

* What bug does the patch fix? What features does the patch add?

When a gm, who's ported to a battleground, log out in it, he's added to battleground players.

As a result:

- When gm logs in, it may appear one of raid groups.

- When battleground is arena, and remaining players fight 1x1, gm's logout make random team win arena. If it's 2x1, it _may_ lead to win.

* For which repository revision was the patch created?

11959

* Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

don't know

* Who has been writing this patch? Please include either forum user names or email addresses.

me

http://paste2.org/p/1978844

Index: C:/wr-core_temp/test-zone/code/src/game/WorldSession.cpp
===================================================================
--- C:/wr-core_temp/test-zone/code/src/game/WorldSession.cpp	(revision 6365)
+++ C:/wr-core_temp/test-zone/code/src/game/WorldSession.cpp	(revision 6366)
@@ -418,7 +418,10 @@

        //drop a flag if player is carrying it
        if(BattleGround *bg = _player->GetBattleGround())
-            bg->EventPlayerLoggedOut(_player);
+            if (bg->IsPlayerInBattleGround(_player->GetObjectGuid()))
+                bg->EventPlayerLoggedOut(_player);
+            else
+            {
+                _player->TeleportToBGEntryPoint();
+                _player->SetBattleGroundId(0, BATTLEGROUND_TYPE_NONE);
+            }

        ///- Teleport to home if the player is in an invalid instance
        if(!_player->m_InstanceValid && !_player->isGameMaster())

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use