diff --git a/src/object/client/ObjMgr.cpp b/src/object/client/ObjMgr.cpp index b7bb53c..0d48842 100644 --- a/src/object/client/ObjMgr.cpp +++ b/src/object/client/ObjMgr.cpp @@ -1,5 +1,4 @@ #include "object/client/ObjMgr.hpp" -#include "object/client/ClntObjMgr.hpp" #if defined(WHOA_SYSTEM_WIN) static thread_local ClntObjMgr* s_curMgr; @@ -7,6 +6,8 @@ static thread_local ClntObjMgr* s_curMgr; static ClntObjMgr* s_curMgr; #endif +static ClntObjMgr* s_savMgr; + uint32_t ClntObjMgrGetMapID() { if (!s_curMgr) { return 0; @@ -14,3 +15,12 @@ uint32_t ClntObjMgrGetMapID() { return s_curMgr->m_mapID; } + +void ClntObjMgrPush(ClntObjMgr* mgr) { + if (s_savMgr || mgr == s_curMgr) { + return; + } + + s_savMgr = s_curMgr; + s_curMgr = mgr; +} diff --git a/src/object/client/ObjMgr.hpp b/src/object/client/ObjMgr.hpp index 99a8ce5..feb0ff4 100644 --- a/src/object/client/ObjMgr.hpp +++ b/src/object/client/ObjMgr.hpp @@ -1,8 +1,11 @@ #ifndef OBJECT_CLIENT_OBJ_MGR_HPP #define OBJECT_CLIENT_OBJ_MGR_HPP +#include "object/client/ClntObjMgr.hpp" #include uint32_t ClntObjMgrGetMapID(); +void ClntObjMgrPush(ClntObjMgr* mgr); + #endif