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

78 lines
1.9 KiB
C++

#include "NPCText.h"
#include "Engine/Source/Base/CDataStore.h"
#include "Engine/Source/Storm/H/storm.h"
// VERIFY: e8ce9f4d manual
// OFFSET: 0x00668070
NPCText::~NPCText() {
for (int32_t i = 0; i < 8; i++) {
if (this->m_text[i][0]) {
SMemFree(this->m_text[i][0], __FILE__, __LINE__, 0);
}
if (this->m_text[i][1]) {
SMemFree(this->m_text[i][1], __FILE__, __LINE__, 0);
}
}
}
// VERIFY: 4f03db70 manual
// OFFSET: 0x0098E1F0
void NPCText::Pack(CDataStore* msg) {
for (uint32_t i = 0; i < 8; i++) {
msg->Put(this->m_probability[i]);
if (this->m_text[i][0]) {
msg->PutString(this->m_text[i][0]);
} else {
msg->PutString("");
}
if (this->m_text[i][1]) {
msg->PutString(this->m_text[i][1]);
} else {
msg->PutString("");
}
msg->Put(this->m_language[i]);
for (int32_t j = 0; j < 3; j++) {
msg->Put(this->m_emoteDelay[i][j]);
msg->Put(this->m_emote[i][j]);
}
}
}
// VERIFY: 85422c48 manual
// OFFSET: 0x0098E2C0
void NPCText::Unpack(CDataStore* msg) {
char buffer[3000];
for (int32_t i = 0; i < 8; i++) {
msg->Get(this->m_probability[i]);
msg->GetString(buffer, sizeof(buffer));
if (this->m_text[i][0]) {
SMemFree(this->m_text[i][0], __FILE__, __LINE__, 0);
}
this->m_text[i][0] = buffer[0] ? SStrDupA(buffer, __FILE__, __LINE__) : nullptr;
msg->GetString(buffer, sizeof(buffer));
if (this->m_text[i][1]) {
SMemFree(this->m_text[i][1], __FILE__, __LINE__, 0);
}
this->m_text[i][1] = buffer[0] ? SStrDupA(buffer, __FILE__, __LINE__) : nullptr;
msg->Get(this->m_language[i]);
for (int32_t j = 0; j < 3; j++) {
msg->Get(this->m_emoteDelay[i][j]);
msg->Get(this->m_emote[i][j]);
}
}
}