Skip to content

Instantly share code, notes, and snippets.

@Nighoo
Created October 20, 2011 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nighoo/1301175 to your computer and use it in GitHub Desktop.
Save Nighoo/1301175 to your computer and use it in GitHub Desktop.
diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index 792345f..a849ffb 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -285,7 +285,11 @@ BattleGround::~BattleGround()
DelObject(i);
sBattleGroundMgr.RemoveBattleGround(GetInstanceID(), GetTypeID());
- sBattleGroundMgr.DeleteClientVisibleInstanceId(GetTypeID(), GetBracketId(), GetClientInstanceID());
+
+ // skip template battlegrounds
+ BattleGroundBracketId bracket_id = GetBracketId();
+ if (bracket_id < MAX_BATTLEGROUND_BRACKETS)
+ sBattleGroundMgr.DeleteClientVisibleInstanceId(GetTypeID(), bracket_id, GetClientInstanceID());
// unload map
// map can be null at bg destruction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment