feat(object): add ClntObjMgrGetPlayerType

This commit is contained in:
fallenoak 2026-02-05 22:22:01 -06:00
parent 61303b51a2
commit 5b88141acb
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
4 changed files with 16 additions and 1 deletions

View File

@ -78,6 +78,11 @@ enum OUT_OF_RANGE_TYPE {
OUT_OF_RANGE_2 = 2, OUT_OF_RANGE_2 = 2,
}; };
enum PLAYER_TYPE {
PLAYER_NORMAL = 0,
PLAYER_BOT = 1,
};
enum SHEATHE_TYPE { enum SHEATHE_TYPE {
SHEATHE_0 = 0, SHEATHE_0 = 0,
SHEATHE_1 = 1, SHEATHE_1 = 1,

View File

@ -18,8 +18,12 @@ class ClntObjMgr {
STORM_EXPLICIT_LIST(CGObject_C, m_link) m_reenabledObjects; STORM_EXPLICIT_LIST(CGObject_C, m_link) m_reenabledObjects;
// TODO // TODO
WOWGUID m_activePlayer = 0; WOWGUID m_activePlayer = 0;
PLAYER_TYPE m_type;
uint32_t m_mapID = 0; uint32_t m_mapID = 0;
ClientConnection* m_net = nullptr; ClientConnection* m_net = nullptr;
// Member functions
ClntObjMgr(PLAYER_TYPE type) : m_type(type) {};
}; };
#endif #endif

View File

@ -141,6 +141,10 @@ uint32_t ClntObjMgrGetMapID() {
return s_curMgr->m_mapID; return s_curMgr->m_mapID;
} }
PLAYER_TYPE ClntObjMgrGetPlayerType() {
return s_curMgr->m_type;
}
void ClntObjMgrInitializeShared() { void ClntObjMgrInitializeShared() {
if (!s_heapsAllocated) { if (!s_heapsAllocated) {
for (int32_t i = ID_ITEM; i < NUM_CLIENT_OBJECT_TYPES; i++) { for (int32_t i = ID_ITEM; i < NUM_CLIENT_OBJECT_TYPES; i++) {
@ -158,7 +162,7 @@ void ClntObjMgrInitializeShared() {
void ClntObjMgrInitializeStd(uint32_t mapID) { void ClntObjMgrInitializeStd(uint32_t mapID) {
// TODO last instance time // TODO last instance time
auto mgr = STORM_NEW(ClntObjMgr); auto mgr = STORM_NEW(ClntObjMgr)(PLAYER_NORMAL);
g_clientConnection->SetObjMgr(mgr); g_clientConnection->SetObjMgr(mgr);
mgr->m_net = g_clientConnection; mgr->m_net = g_clientConnection;

View File

@ -16,6 +16,8 @@ ClntObjMgr* ClntObjMgrGetCurrent();
uint32_t ClntObjMgrGetMapID(); uint32_t ClntObjMgrGetMapID();
PLAYER_TYPE ClntObjMgrGetPlayerType();
void ClntObjMgrInitializeShared(); void ClntObjMgrInitializeShared();
void ClntObjMgrInitializeStd(uint32_t mapID); void ClntObjMgrInitializeStd(uint32_t mapID);