Files
SatyandClaude Opus 5.5 3b857f3eb0 Object port: object classes, object manager, input control, WOWGUID type
- CGObject_C base, CEffect, CObjectEffect/CObjectEffectManager effect states
- Unit, Player, Item/Container/Bag, Corpse, DynamicObject, GameObject and
  all GameObject type classes (vtables matched slot by slot), Movement,
  MovementShared, Missile, Vehicle/Passenger/Camera, combat log, caches
- Client object manager (0x4D3100-0x4D7880) incl. SMSG_UPDATE_OBJECT,
  SMSG_COMPRESSED_UPDATE_OBJECT, SMSG_DESTROY_OBJECT; type ctors/PostInit
- CGGameUI::CanPerformAction and the ready part of CGInputControl
- Layouts named from descriptor fields and code; CM2Model 0x134 matrix,
  CClientObjCreate tail, CGUnit_C/CGPlayer_C sizes 0x1008/0x1958
- WOWGUID struct replaces the IDB's WGUID low/high pair and guid uint64_t;
  SmartGUID derives from it; member functions returning a guid keep
  uint64_t (MSVC returns class types from members via hidden pointer);
  structs with 4-aligned guids in 12340 use pack(4)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-29 12:27:05 +02:00

104 lines
2.5 KiB
C++

#include "GameObjectStats.h"
#include "Engine/Source/Base/CDataStore.h"
#include "Engine/Source/Storm/H/storm.h"
#include "WoW/Source/DB/DBClient/GameObjectStats_C.h"
// VERIFY: ce0291e3 manual
// OFFSET: 0x00667FA0
GameObjectStats::~GameObjectStats() {
for (int32_t i = 0; i < 4; i++) {
if (this->m_name[i]) {
SMemFree(this->m_name[i], __FILE__, __LINE__, 0);
}
}
if (this->m_iconName) {
SMemFree(this->m_iconName, __FILE__, __LINE__, 0);
}
if (this->m_castBarCaption) {
SMemFree(this->m_castBarCaption, __FILE__, __LINE__, 0);
}
if (this->m_closeText) {
SMemFree(this->m_closeText, __FILE__, __LINE__, 0);
}
}
// VERIFY: 2eee94f4 auto
// OFFSET: 0x004FD1E0
const char* GameObjectStats::GetName(int32_t index) {
const char* name = this->m_name[index];
if (!name || !*name) {
return this->m_name[0];
}
return name;
}
// VERIFY: e40346c6 auto
// OFFSET: 0x0098D680
void GameObjectStats::Pack(CDataStore* msg) {
msg->Put(this->m_typeID);
msg->Put(this->m_displayID);
for (int32_t i = 0; i < 4; i++) {
if (this->m_name[i]) {
msg->PutString(this->m_name[i]);
} else {
msg->PutString("");
}
}
msg->PutString(this->m_iconName);
msg->PutString(this->m_castBarCaption);
msg->PutString(this->m_closeText);
for (int32_t i = 0; i < 24; i++) {
msg->Put(this->m_propValue[i]);
}
msg->Put(this->m_scale);
for (int32_t i = 0; i < 6; i++) {
msg->Put(this->m_questItems[i]);
}
}
// VERIFY: f6967214 manual
// OFFSET: 0x0098D750
void GameObjectStats_C::Unpack(CDataStore* msg) {
char buffer[1024];
msg->Get(this->m_typeID);
msg->Get(this->m_displayID);
for (int32_t i = 0; i < 4; i++) {
msg->GetString(buffer, sizeof(buffer));
if (buffer[0]) {
this->m_name[i] = SStrDupA(buffer, __FILE__, __LINE__);
} else {
this->m_name[i] = nullptr;
}
}
msg->GetString(buffer, sizeof(buffer));
this->m_iconName = SStrDupA(buffer, __FILE__, __LINE__);
msg->GetString(buffer, sizeof(buffer));
this->m_castBarCaption = SStrDupA(buffer, __FILE__, __LINE__);
msg->GetString(buffer, sizeof(buffer));
this->m_closeText = SStrDupA(buffer, __FILE__, __LINE__);
for (int32_t i = 0; i < 24; i++) {
msg->Get(this->m_propValue[i]);
}
msg->Get(this->m_scale);
for (int32_t i = 0; i < 6; i++) {
msg->Get(this->m_questItems[i]);
}
}