From ee48e47992791de8af679b4146cac4ffdcb2aef6 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Thu, 5 Feb 2026 15:58:48 -0600 Subject: [PATCH] feat(object): add CGPlayer_C::GetActiveXP --- src/object/client/CGPlayer_C.cpp | 9 +++++++++ src/object/client/CGPlayer_C.hpp | 1 + 2 files changed, 10 insertions(+) diff --git a/src/object/client/CGPlayer_C.cpp b/src/object/client/CGPlayer_C.cpp index e34f048..cb43f4c 100644 --- a/src/object/client/CGPlayer_C.cpp +++ b/src/object/client/CGPlayer_C.cpp @@ -1,5 +1,6 @@ #include "object/client/CGPlayer_C.hpp" #include "db/Db.hpp" +#include "object/client/ObjMgr.hpp" #include "object/Types.hpp" #include @@ -11,6 +12,14 @@ CGPlayer_C::~CGPlayer_C() { // TODO } +uint32_t CGPlayer_C::GetActiveXP() const { + if (this->GetGUID() != ClntObjMgrGetActivePlayer()) { + return 0; + } + + return this->GetXP(); +} + void CGPlayer_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4) { // TODO diff --git a/src/object/client/CGPlayer_C.hpp b/src/object/client/CGPlayer_C.hpp index e224be4..85db184 100644 --- a/src/object/client/CGPlayer_C.hpp +++ b/src/object/client/CGPlayer_C.hpp @@ -15,6 +15,7 @@ class CGPlayer_C : public CGUnit_C, public CGPlayer { // Public member functions CGPlayer_C(uint32_t time, CClientObjCreate& objCreate); + uint32_t GetActiveXP() const; void PostInit(uint32_t time, const CClientObjCreate& init, bool a4); void SetStorage(uint32_t* storage, uint32_t* saved); };