mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(object): add ClntObjMgrPush
This commit is contained in:
parent
35787c4ac8
commit
0e685d6fbd
@ -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;
|
||||
}
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
#ifndef OBJECT_CLIENT_OBJ_MGR_HPP
|
||||
#define OBJECT_CLIENT_OBJ_MGR_HPP
|
||||
|
||||
#include "object/client/ClntObjMgr.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
uint32_t ClntObjMgrGetMapID();
|
||||
|
||||
void ClntObjMgrPush(ClntObjMgr* mgr);
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user