mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22: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/ObjMgr.hpp"
|
||||||
#include "object/client/ClntObjMgr.hpp"
|
|
||||||
|
|
||||||
#if defined(WHOA_SYSTEM_WIN)
|
#if defined(WHOA_SYSTEM_WIN)
|
||||||
static thread_local ClntObjMgr* s_curMgr;
|
static thread_local ClntObjMgr* s_curMgr;
|
||||||
@ -7,6 +6,8 @@ static thread_local ClntObjMgr* s_curMgr;
|
|||||||
static ClntObjMgr* s_curMgr;
|
static ClntObjMgr* s_curMgr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static ClntObjMgr* s_savMgr;
|
||||||
|
|
||||||
uint32_t ClntObjMgrGetMapID() {
|
uint32_t ClntObjMgrGetMapID() {
|
||||||
if (!s_curMgr) {
|
if (!s_curMgr) {
|
||||||
return 0;
|
return 0;
|
||||||
@ -14,3 +15,12 @@ uint32_t ClntObjMgrGetMapID() {
|
|||||||
|
|
||||||
return s_curMgr->m_mapID;
|
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
|
#ifndef OBJECT_CLIENT_OBJ_MGR_HPP
|
||||||
#define OBJECT_CLIENT_OBJ_MGR_HPP
|
#define OBJECT_CLIENT_OBJ_MGR_HPP
|
||||||
|
|
||||||
|
#include "object/client/ClntObjMgr.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
uint32_t ClntObjMgrGetMapID();
|
uint32_t ClntObjMgrGetMapID();
|
||||||
|
|
||||||
|
void ClntObjMgrPush(ClntObjMgr* mgr);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user