feat(object): link newly created objects to visible list

This commit is contained in:
fallenoak 2026-01-13 22:34:44 -06:00
parent 72d5247563
commit 56f645fe3b
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
3 changed files with 8 additions and 1 deletions

View File

@ -6,9 +6,13 @@
#include "object/client/CGObject.hpp" #include "object/client/CGObject.hpp"
#include "util/GUID.hpp" #include "util/GUID.hpp"
#include <storm/Hash.hpp> #include <storm/Hash.hpp>
#include <storm/List.hpp>
class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID> { class CGObject_C : public CGObject, public TSHashObject<CGObject_C, CHashKeyGUID> {
public: public:
// Public member variables
TSLink<CGObject_C> m_link;
// Public member functions // Public member functions
CGObject_C() = default; CGObject_C() = default;
CGObject_C(uint32_t time, CClientObjCreate& objCreate); CGObject_C(uint32_t time, CClientObjCreate& objCreate);

View File

@ -3,6 +3,7 @@
#include "object/client/CGObject_C.hpp" #include "object/client/CGObject_C.hpp"
#include <storm/Hash.hpp> #include <storm/Hash.hpp>
#include <storm/List.hpp>
#include <cstdint> #include <cstdint>
class ClientConnection; class ClientConnection;
@ -12,6 +13,8 @@ class ClntObjMgr {
// Member variables // Member variables
TSHashTable<CGObject_C, CHashKeyGUID> m_objects; TSHashTable<CGObject_C, CHashKeyGUID> m_objects;
// TODO // TODO
STORM_EXPLICIT_LIST(CGObject_C, m_link) m_visibleObjects;
// TODO
WOWGUID m_activePlayer = 0; WOWGUID m_activePlayer = 0;
uint32_t m_mapID = 0; uint32_t m_mapID = 0;
ClientConnection* m_net = nullptr; ClientConnection* m_net = nullptr;

View File

@ -205,7 +205,7 @@ int32_t CreateObject(CDataStore* msg, uint32_t time) {
InitObject(newObject, time, objCreate); InitObject(newObject, time, objCreate);
// TODO link to one of the ClntObjMgr lists ClntObjMgrGetCurrent()->m_visibleObjects.LinkToTail(newObject);
return 1; return 1;
} }