mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-07 07:09:53 +03:00
feat(object): add ClntObjMgrObjectPtr
This commit is contained in:
2 files changed
+21
No files matched your search
@@ -11,6 +11,7 @@
|
||||
#include "object/client/CGPlayer_C.hpp"
|
||||
#include "object/client/CGUnit_C.hpp"
|
||||
#include "object/client/MessageHandlers.hpp"
|
||||
#include "object/client/Util.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
#include <common/ObjectAlloc.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);
|
||||
}
|
||||
|
||||
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() {
|
||||
if (!s_savMgr) {
|
||||
return;
|
||||
|
||||
@@ -20,6 +20,8 @@ void ClntObjMgrInitializeStd(uint32_t mapID);
|
||||
|
||||
void ClntObjMgrLinkInNewObject(CGObject_C* object);
|
||||
|
||||
CGObject_C* ClntObjMgrObjectPtr(WOWGUID guid, OBJECT_TYPE type);
|
||||
|
||||
void ClntObjMgrPop();
|
||||
|
||||
void ClntObjMgrPush(ClntObjMgr* mgr);
|
||||
|
||||
Reference in new issue
Block a user