Jump to content

Recommended Posts

Posted

This patch would fix the bug that ppl cannot enter pre-wotlk instances in heroic mode as the server reports that the instance is full, which is caused by maxPlayers == 0.

With this patch such instances would use their normal maxPlayers value from dbc.

Bug report thread: http://getmangos.eu/community/viewtopic.php?id=11123

From 18ef283d4707aac672deed26b06d44336399344d Mon Sep 17 00:00:00 2001
From: Lightguard <[email="[email protected]"][email protected][/email]>
Date: Tue, 24 Nov 2009 09:25:23 +0100
Subject: [PATCH 1/1] - Fix heroic instance difficulty/maxPlayers issue
Signed-off-by: Lightguard <[email="[email protected]"][email protected][/email]>
---
src/game/Map.cpp |   14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index 1a4d642..056c312 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -1134,8 +1134,18 @@ MapDifficulty const* Map::GetMapDifficulty() const

uint32 Map::GetMaxPlayers() const
{
-    MapDifficulty const* mapDiff = GetMapDifficulty();
-    return mapDiff ? mapDiff->maxPlayers : 0;
+    if(MapDifficulty const* mapDiff = GetMapDifficulty())
+    {
+        if(mapDiff->maxPlayers)                 // Normal case
+            return mapDiff->maxPlayers;
+        else                                    // We have no maxplayers for heroic insances with expansion < 2
+        {                                       // The heroic entry exists, so we don't have to check anything, simply return normal max players
+            MapDifficulty const* normalDiff = GetMapDifficultyData(i_id, DUNGEON_DIFFICULTY_NORMAL);
+            return normalDiff ? normalDiff->maxPlayers : 0;
+        }
+    }
+    else                                        // I'd rather assert(false);
+        return 0;
}

uint32 Map::GetMaxResetDelay() const
-- 
1.6.5.1.1367.gcd48

Patchfile

  • 39 years later...
Posted

I make 2 small changes

1) no reason re-lookup entry for regular difficulty with maxplayers==0

2) base at fact that we not make destination dungeon/raid in related code better use REGULAR_DIFFICULTY as common name

for basic map difficulty for any maps types

In [8884]. Thank you :)

Guest
This topic is now closed to further replies.
×
×
  • 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