From 5b88141acb57ff96dbd6c9dd76a449d0cd3e113d Mon Sep 17 00:00:00 2001 From: fallenoak Date: Thu, 5 Feb 2026 22:22:01 -0600 Subject: [PATCH] feat(object): add ClntObjMgrGetPlayerType --- src/object/Types.hpp | 5 +++++ src/object/client/ClntObjMgr.hpp | 4 ++++ src/object/client/ObjMgr.cpp | 6 +++++- src/object/client/ObjMgr.hpp | 2 ++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/object/Types.hpp b/src/object/Types.hpp index 952e619..9ce56c2 100644 --- a/src/object/Types.hpp +++ b/src/object/Types.hpp @@ -78,6 +78,11 @@ enum OUT_OF_RANGE_TYPE { OUT_OF_RANGE_2 = 2, }; +enum PLAYER_TYPE { + PLAYER_NORMAL = 0, + PLAYER_BOT = 1, +}; + enum SHEATHE_TYPE { SHEATHE_0 = 0, SHEATHE_1 = 1, diff --git a/src/object/client/ClntObjMgr.hpp b/src/object/client/ClntObjMgr.hpp index 30f8c97..6415fbd 100644 --- a/src/object/client/ClntObjMgr.hpp +++ b/src/object/client/ClntObjMgr.hpp @@ -18,8 +18,12 @@ class ClntObjMgr { STORM_EXPLICIT_LIST(CGObject_C, m_link) m_reenabledObjects; // TODO WOWGUID m_activePlayer = 0; + PLAYER_TYPE m_type; uint32_t m_mapID = 0; ClientConnection* m_net = nullptr; + + // Member functions + ClntObjMgr(PLAYER_TYPE type) : m_type(type) {}; }; #endif diff --git a/src/object/client/ObjMgr.cpp b/src/object/client/ObjMgr.cpp index c817841..bd1c860 100644 --- a/src/object/client/ObjMgr.cpp +++ b/src/object/client/ObjMgr.cpp @@ -141,6 +141,10 @@ uint32_t ClntObjMgrGetMapID() { return s_curMgr->m_mapID; } +PLAYER_TYPE ClntObjMgrGetPlayerType() { + return s_curMgr->m_type; +} + void ClntObjMgrInitializeShared() { if (!s_heapsAllocated) { for (int32_t i = ID_ITEM; i < NUM_CLIENT_OBJECT_TYPES; i++) { @@ -158,7 +162,7 @@ void ClntObjMgrInitializeShared() { void ClntObjMgrInitializeStd(uint32_t mapID) { // TODO last instance time - auto mgr = STORM_NEW(ClntObjMgr); + auto mgr = STORM_NEW(ClntObjMgr)(PLAYER_NORMAL); g_clientConnection->SetObjMgr(mgr); mgr->m_net = g_clientConnection; diff --git a/src/object/client/ObjMgr.hpp b/src/object/client/ObjMgr.hpp index f467d9d..d50f0a1 100644 --- a/src/object/client/ObjMgr.hpp +++ b/src/object/client/ObjMgr.hpp @@ -16,6 +16,8 @@ ClntObjMgr* ClntObjMgrGetCurrent(); uint32_t ClntObjMgrGetMapID(); +PLAYER_TYPE ClntObjMgrGetPlayerType(); + void ClntObjMgrInitializeShared(); void ClntObjMgrInitializeStd(uint32_t mapID);