From d520b47523c168eeaf20394823f1e63f8eadde21 Mon Sep 17 00:00:00 2001 From: Foereaper Date: Sun, 2 Jun 2024 02:15:10 +0200 Subject: [PATCH] Use enum in ReloadElunaForMap --- ElunaLoader.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/ElunaLoader.cpp b/ElunaLoader.cpp index 2a7a6fdfc3..b48238be0c 100644 --- a/ElunaLoader.cpp +++ b/ElunaLoader.cpp @@ -332,16 +332,12 @@ bool ElunaLoader::ShouldMapLoadEluna(uint32 id) void ElunaLoader::ReloadElunaForMap(int mapId) { - const int mapid_reload_cache_only = -3; - const int mapid_reload_all = -2; // reserved for reloading all states (default if no args) - const int mapid_reload_global = -1; // reserved for reloading global state - // otherwise reload the state of the specific mapid // If a mapid is provided but does not match any map or reserved id then only script storage is loaded - sElunaLoader->LoadScripts(); - if (mapId != mapid_reload_cache_only) + + if (mapId != RELOAD_CACHE_ONLY) { - if (mapId == mapid_reload_global || mapId == mapid_reload_all) + if (mapId == RELOAD_GLOBAL_STATE || mapId == RELOAD_ALL_STATES) #ifdef TRINITY if (sWorld->GetEluna()) sWorld->GetEluna()->ReloadEluna(); @@ -356,11 +352,9 @@ void ElunaLoader::ReloadElunaForMap(int mapId) sMapMgr.DoForAllMaps([&](Map* map) #endif { - if (mapId == mapid_reload_all || mapId == static_cast(map->GetId())) - { + if (mapId == RELOAD_ALL_STATES || mapId == static_cast(map->GetId())) if (map->GetEluna()) map->GetEluna()->ReloadEluna(); - } } ); }