From f5e0686b6ebd87aa6961564fcc765e69bb9017c8 Mon Sep 17 00:00:00 2001 From: Ercules76 Date: Tue, 22 Aug 2017 22:19:41 +0200 Subject: [PATCH] Fix LFG last player disband party (#574) * [CORE/LFG] now last player disband party when left dungeon --- src/game/Scripting/ScriptMgr.cpp | 7 +++---- src/game/Scripting/ScriptMgr.h | 8 +++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/game/Scripting/ScriptMgr.cpp b/src/game/Scripting/ScriptMgr.cpp index bea0e71a0..da56fe790 100644 --- a/src/game/Scripting/ScriptMgr.cpp +++ b/src/game/Scripting/ScriptMgr.cpp @@ -126,10 +126,9 @@ class ScriptRegistry // Utility macros for looping over scripts. #define FOR_SCRIPTS(T, C, E) \ - if (SCR_REG_LST(T).empty()) \ - return; \ - for (SCR_REG_ITR(T) C = SCR_REG_LST(T).begin(); \ - C != SCR_REG_LST(T).end(); ++C) + if (!SCR_REG_LST(T).empty()) \ + for (SCR_REG_ITR(T) C = SCR_REG_LST(T).begin(); \ + C != SCR_REG_LST(T).end(); ++C) #define FOR_SCRIPTS_RET(T, C, E, R) \ if (SCR_REG_LST(T).empty()) \ return R; \ diff --git a/src/game/Scripting/ScriptMgr.h b/src/game/Scripting/ScriptMgr.h index 1f0965f02..ffba36df5 100644 --- a/src/game/Scripting/ScriptMgr.h +++ b/src/game/Scripting/ScriptMgr.h @@ -1290,13 +1290,15 @@ class ScriptMgr public: /* AllCreatureScript */ - void OnAllCreatureUpdate(Creature* creature, uint32 diff); + //listener function (OnAllCreatureUpdate) is called by OnCreatureUpdate + //void OnAllCreatureUpdate(Creature* creature, uint32 diff); void Creature_SelectLevel(const CreatureTemplate *cinfo, Creature* creature); public: /* AllMapScript */ - void OnPlayerEnterMapAll(Map* map, Player* player); - void OnPlayerLeaveMapAll(Map* map, Player* player); + //listener functions are called by OnPlayerEnterMap and OnPlayerLeaveMap + //void OnPlayerEnterAll(Map* map, Player* player); + //void OnPlayerLeaveAll(Map* map, Player* player); private: