feat(object): add CGPlayer_C::GetActiveXP

This commit is contained in:
fallenoak 2026-02-05 15:58:48 -06:00
parent 5d81022c74
commit ee48e47992
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#include "object/client/CGPlayer_C.hpp" #include "object/client/CGPlayer_C.hpp"
#include "db/Db.hpp" #include "db/Db.hpp"
#include "object/client/ObjMgr.hpp"
#include "object/Types.hpp" #include "object/Types.hpp"
#include <storm/Error.hpp> #include <storm/Error.hpp>
@ -11,6 +12,14 @@ CGPlayer_C::~CGPlayer_C() {
// TODO // 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) { void CGPlayer_C::PostInit(uint32_t time, const CClientObjCreate& init, bool a4) {
// TODO // TODO

View File

@ -15,6 +15,7 @@ class CGPlayer_C : public CGUnit_C, public CGPlayer {
// Public member functions // Public member functions
CGPlayer_C(uint32_t time, CClientObjCreate& objCreate); CGPlayer_C(uint32_t time, CClientObjCreate& objCreate);
uint32_t GetActiveXP() const;
void PostInit(uint32_t time, const CClientObjCreate& init, bool a4); void PostInit(uint32_t time, const CClientObjCreate& init, bool a4);
void SetStorage(uint32_t* storage, uint32_t* saved); void SetStorage(uint32_t* storage, uint32_t* saved);
}; };