Jump to content

[9157][Patch] Prevent crash when GM is in BG or Arena and ending BG or Arena


Recommended Posts

Posted

Happy new year :)

How test bug ?

.goname [player in bg]

Again

.goname [player in bg]

Server Crash when ending BG

How ?!

BG teleport GM to BG :P

Fix for Mangos-0.12

diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index 4b28192..e78f9e1 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -504,7 +504,8 @@ bool ChatHandler::HandleGonameCommand(const char* args)
            // when porting out from the bg, it will be reset to 0
            _player->SetBattleGroundId(target->GetBattleGroundId());
            // remember current position as entry point for return at bg end teleportation
-            _player->SetBattleGroundEntryPoint(_player->GetMapId(),_player->GetPositionX(),_player->GetPositionY(),_player->GetPositionZ(),_player->GetOrientation());
+            if (!_player->GetMap()->IsBattleGroundOrArena())
+                _player->SetBattleGroundEntryPoint(_player->GetMapId(),_player->GetPositionX(),_player->GetPositionY(),_player->GetPositionZ(),_player->GetOrientation());
        }
        else if(cMap->IsDungeon())
        {

Fix for Master

diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index 2c3faef..e2861eb 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -507,7 +507,8 @@ bool ChatHandler::HandleGonameCommand(const char* args)
            // when porting out from the bg, it will be reset to 0
            _player->SetBattleGroundId(target->GetBattleGroundId(), target->GetBattleGroundTypeId());
            // remember current position as entry point for return at bg end teleportation
-            _player->SetBattleGroundEntryPoint();
+            if (!_player->GetMap()->IsBattleGroundOrArena())
+                _player->SetBattleGroundEntryPoint();
        }
        else if(cMap->IsDungeon())
        {

Note:

I test it only for Mangos-0.12

×
×
  • 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