mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(object): add ClntObjMgrObjectPtr
This commit is contained in:
parent
7e994ff195
commit
2bb8da6971
@ -11,6 +11,7 @@
|
|||||||
#include "object/client/CGPlayer_C.hpp"
|
#include "object/client/CGPlayer_C.hpp"
|
||||||
#include "object/client/CGUnit_C.hpp"
|
#include "object/client/CGUnit_C.hpp"
|
||||||
#include "object/client/MessageHandlers.hpp"
|
#include "object/client/MessageHandlers.hpp"
|
||||||
|
#include "object/client/Util.hpp"
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
#include <common/ObjectAlloc.hpp>
|
#include <common/ObjectAlloc.hpp>
|
||||||
#include <storm/Memory.hpp>
|
#include <storm/Memory.hpp>
|
||||||
@ -143,6 +144,24 @@ void ClntObjMgrLinkInNewObject(CGObject_C* object) {
|
|||||||
s_curMgr->m_objects.Insert(object, object->m_obj->m_guid, key);
|
s_curMgr->m_objects.Insert(object, object->m_obj->m_guid, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGObject_C* ClntObjMgrObjectPtr(WOWGUID guid, OBJECT_TYPE type) {
|
||||||
|
if (!s_curMgr || !guid) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto object = FindActiveObject(guid);
|
||||||
|
|
||||||
|
if (!object) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(object->m_obj->m_type & type)) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
void ClntObjMgrPop() {
|
void ClntObjMgrPop() {
|
||||||
if (!s_savMgr) {
|
if (!s_savMgr) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -20,6 +20,8 @@ void ClntObjMgrInitializeStd(uint32_t mapID);
|
|||||||
|
|
||||||
void ClntObjMgrLinkInNewObject(CGObject_C* object);
|
void ClntObjMgrLinkInNewObject(CGObject_C* object);
|
||||||
|
|
||||||
|
CGObject_C* ClntObjMgrObjectPtr(WOWGUID guid, OBJECT_TYPE type);
|
||||||
|
|
||||||
void ClntObjMgrPop();
|
void ClntObjMgrPop();
|
||||||
|
|
||||||
void ClntObjMgrPush(ClntObjMgr* mgr);
|
void ClntObjMgrPush(ClntObjMgr* mgr);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user