Jump to content

[Fix] Arena: Anti Stealth Buff Objects Spawn Fix


Guest FunkyBit

Recommended Posts

What bug does the patch fix?

It fixes spawing of the buff objects in arenas that grant after 90 seconds of the match a buff that increases stealth detection. These objects didn't spwan anymore.

For which repository revision was the patch created?

For mangos-0.12 originally. As far as I checked the problem exists in master, too.

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

Myself

diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround.cpp
index bed382d..b98e9de 100644
--- a/src/game/BattleGround.cpp
+++ b/src/game/BattleGround.cpp
@@ -53,6 +53,8 @@ BattleGround::BattleGround()
    m_LevelMax          = 0;
    m_InBGFreeSlotQueue = false;
    m_SetDeleteThis     = false;
+
+    m_ArenaBuffTimer    = 0;

    m_MaxPlayersPerTeam = 0;
    m_MaxPlayers        = 0;
@@ -215,11 +236,11 @@ void BattleGround::Update(uint32 diff)
    if (isArena() && !m_ArenaBuffSpawned)
    {
        // 60 seconds after start the buffobjects in arena should get spawned
-        if (m_StartTime > START_DELAY1 + ARENA_SPAWN_BUFF_OBJECTS)
+        if (m_ArenaBuffTimer > START_DELAY1 + ARENA_SPAWN_BUFF_OBJECTS)
        {
            SpawnEvent(ARENA_BUFF_EVENT, 0, true);
            m_ArenaBuffSpawned = true;
-        }
+        } else m_ArenaBuffTimer += diff;
    }

    /*********************************************************/
diff --git a/src/game/BattleGround.h b/src/game/BattleGround.h
index 5ee9041..502cf3a 100644
--- a/src/game/BattleGround.h
+++ b/src/game/BattleGround.h
@@ -28,7 +28,7 @@
#define BG_EVENT_DOOR 254
// only arena event
// cause this buff apears 90sec after start in every bg i implement it here
-#define ARENA_BUFF_EVENT 252
+#define ARENA_BUFF_EVENT 253


class Creature;
@@ -532,6 +532,7 @@ class BattleGround
        bool   m_InBGFreeSlotQueue;                         // used to make sure that BG is only once inserted into the BattleGroundMgr.BGFreeSlotQueue[bgTypeId] deque
        bool   m_SetDeleteThis;                             // used for safe deletion of the bg after end / all players leave
        bool   m_IsArena;
+        uint32 m_ArenaBuffTimer;
        uint8  m_Winner;                                    // 0=alliance, 1=horde, 2=none
        int32  m_StartDelayTime;
        bool   m_IsRated;                                   // is this battle rated?

Problem was that 'm_StartTime' is not increasing, it stays 0, and the if always results in false.

The part about

-#define ARENA_BUFF_EVENT 252

+#define ARENA_BUFF_EVENT 253

is optinal and not realy MaNGOS problem and only included because UDB and TBCDB use 253 as spawn event for these objects. Otherwise the database content must be changed in the relevant parts from 253 to 252 as event for these objects.

pastebin link

With best regards

Funkybit

Link to comment
Share on other sites

the original code works fine for me on rev 9119 mangos-0.15, the variable 'm_StartTime' is increased and the spawnevent is fired so the only problem, as you noticed ,it's on database (UDB 386 for me), since there's 253 instead of 252. I simpled changed the value on battleground_events and gameobject_battleground tables to fix it.

Link to comment
Share on other sites

OK, found the problem.

The Master Branch is working.

Master -> Battleground.cpp Line 505/506:

//update start time 
m_StartTime += diff;

These two lines are missing in mangos-0.12.

As written above I'm on mangos-0.12 and just looked over the same parts that are hit by the patch and couldn't find a difference.

So it works for Master, but not for mangos-0-12.

Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...
×
×
  • 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