mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 23:50:44 +01:00
Core/Scripts: FOR_SCRIPTS macro shouldn't return early (#20187)
FOR_SCRIPTS, insteadof FOR_SCRIPTS_RET, shouldn't return
otherwise methods such as void ScriptMgr::OnPlayerEnterMap(Map* map, Player* player) will end prematurely
(cherry picked from commit 4ee16fb536)
This commit is contained in:
@@ -1072,11 +1072,9 @@ private:
|
||||
|
||||
// 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()) \
|
||||
|
||||
Reference in New Issue
Block a user