Files
wowdecomp/_Triage/CClientObjCreate.cpp
T
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

143 lines
3.6 KiB
C++

#include "CClientObjCreate.h"
#include "Engine/Source/Base/CDataStore.h"
// VERIFY: e0224246 auto
// OFFSET: 0x004D3A80
void CClientObjCreate::Skip(CDataStore* msg) {
uint16_t flags = 0;
msg->Get(flags);
if (flags & 0x20) {
CClientMoveUpdate::Skip(msg);
} else if (flags & 0x100) {
C3Vector position(0.0f, 0.0f, 0.0f);
C3Vector transportPosition(0.0f, 0.0f, 0.0f);
SmartGUID transport;
*msg >> transport;
msg->Get(position.x);
msg->Get(position.y);
msg->Get(position.z);
msg->Get(transportPosition.x);
msg->Get(transportPosition.y);
msg->Get(transportPosition.z);
float facing;
msg->Get(facing);
float transportFacing;
msg->Get(transportFacing);
} else if (flags & 0x40) {
C3Vector position(0.0f, 0.0f, 0.0f);
*msg >> position;
float facing;
msg->Get(facing);
}
if (flags & 0x8) {
uint32_t lowGuid = 0;
msg->Get(lowGuid);
}
if (flags & 0x10) {
uint32_t highGuid = 0;
msg->Get(highGuid);
}
if (flags & 0x4) {
SmartGUID target;
*msg >> target;
}
if (flags & 0x2) {
uint32_t transportTime = 0;
msg->Get(transportTime);
}
if (flags & 0x80) {
uint32_t vehicleId = 0;
msg->Get(vehicleId);
uint32_t vehicleOrientation = 0;
msg->Get(vehicleOrientation);
}
if (flags & 0x200) {
uint64_t rotation = 0;
msg->Get(rotation);
}
}
// INLINED
CClientObjCreate::CClientObjCreate() {
this->m_updateFlags = 0;
this->m_attackTarget = WOWGUID();
this->m_packedRotation = 0;
}
// VERIFY: 3e2ce9a0 manual
// OFFSET: 0x004D3890
int32_t CClientObjCreate::Get(CDataStore* msg) {
uint16_t flags = 0;
msg->Get(flags);
this->m_updateFlags = flags;
if (flags & 0x20) {
*msg >> this->m_move;
} else if (flags & 0x100) {
SmartGUID transport;
*msg >> transport;
this->m_move.m_status.m_transportGuid = transport;
msg->Get(this->m_move.m_status.m_position.x);
msg->Get(this->m_move.m_status.m_position.y);
msg->Get(this->m_move.m_status.m_position.z);
msg->Get(this->m_move.m_status.m_transportPosition.x);
msg->Get(this->m_move.m_status.m_transportPosition.y);
msg->Get(this->m_move.m_status.m_transportPosition.z);
msg->Get(this->m_move.m_status.m_facing);
msg->Get(this->m_move.m_status.m_transportFacing);
} else if (flags & 0x40) {
*msg >> this->m_move.m_status.m_position;
msg->Get(this->m_move.m_status.m_facing);
this->m_move.m_status.m_transportGuid = WOWGUID();
this->m_move.m_status.m_transportPosition = this->m_move.m_status.m_position;
}
if (this->m_updateFlags & 0x8) {
msg->Get(this->m_lowGuid);
} else {
this->m_lowGuid = 0;
}
if (this->m_updateFlags & 0x10) {
msg->Get(this->m_highGuid);
} else {
this->m_highGuid = 0;
}
if (this->m_updateFlags & 0x4) {
*msg >> *reinterpret_cast<SmartGUID*>(&this->m_attackTarget);
} else {
this->m_attackTarget = WOWGUID();
}
if (this->m_updateFlags & 0x2) {
msg->Get(this->m_transportTime);
}
if (this->m_updateFlags & 0x80) {
msg->Get(this->m_vehicleId);
msg->Get(this->m_vehicleOrientation);
}
if (this->m_updateFlags & 0x200) {
uint64_t rotation = 0;
msg->Get(rotation);
this->m_packedRotation = rotation;
} else {
this->m_packedRotation = 0;
}
return msg->m_size >= msg->m_read;
}