--check: 938/3256 method bodies compile for x86_64 (28.8%), 32-bit layout asserts hold; boot path 3/626 curated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
109 lines
2.7 KiB
C++
109 lines
2.7 KiB
C++
#include "classes.h"
|
|
|
|
// 00431310
|
|
void EntityRef::constructor(Entity *entity)
|
|
{
|
|
float copyX;
|
|
uint32_t weaknessBit;
|
|
float copyY;
|
|
uint32_t friendlyBit;
|
|
uint32_t charmedBit;
|
|
|
|
if (entity == GHIDRA_CAST<Entity *>(0x0)) {
|
|
this->_type = 0;
|
|
this->_variant = 0;
|
|
this->_spawnerType = 0;
|
|
this->_spawnerVariant = 0;
|
|
copyX = g_vectorZero.x;
|
|
copyY = g_vectorZero.y;
|
|
}
|
|
else {
|
|
this->_type = entity->_type;
|
|
this->_variant = entity->_variant;
|
|
this->_spawnerType = entity->_spawnerType;
|
|
this->_spawnerVariant = entity->_spawnerVariant;
|
|
copyX = (entity->_pos).x;
|
|
copyY = (entity->_pos).y;
|
|
}
|
|
(this->_position).x = copyX;
|
|
(this->_position).y = copyY;
|
|
if (entity == GHIDRA_CAST<Entity *>(0x0)) {
|
|
copyX = g_vectorZero.x;
|
|
copyY = g_vectorZero.y;
|
|
}
|
|
else {
|
|
copyX = (entity->_velocity).x;
|
|
copyY = (entity->_velocity).y;
|
|
}
|
|
(this->_velocity).x = copyX;
|
|
(this->_velocity).y = copyY;
|
|
if ((entity == GHIDRA_CAST<Entity *>(0x0)) || ((entity->_flags & 0x100) == 0)) {
|
|
charmedBit = 0;
|
|
if (entity != GHIDRA_CAST<Entity *>(0x0)) goto LAB_004313dc;
|
|
charmedBit = 0;
|
|
LAB_004313f5:
|
|
friendlyBit = 0;
|
|
if (entity != GHIDRA_CAST<Entity *>(0x0)) goto LAB_004313fb;
|
|
}
|
|
else {
|
|
charmedBit = 1;
|
|
LAB_004313dc:
|
|
if ((entity->_flags & 0x20000000) == 0) goto LAB_004313f5;
|
|
friendlyBit = 2;
|
|
LAB_004313fb:
|
|
if ((entity->_flags & 0x40000000000000) != 0) {
|
|
weaknessBit = 4;
|
|
goto LAB_00431416;
|
|
}
|
|
}
|
|
weaknessBit = 0;
|
|
LAB_00431416:
|
|
this->_entity = entity;
|
|
this->_flags = weaknessBit | friendlyBit | charmedBit;
|
|
return;
|
|
}
|
|
|
|
// 00435c70
|
|
EntityRef::EntityRef()
|
|
{
|
|
this->_type = 0;
|
|
this->_variant = 0;
|
|
this->_spawnerType = 0;
|
|
this->_spawnerVariant = 0;
|
|
(this->_position).x = g_vectorZero.x;
|
|
(this->_position).y = g_vectorZero.y;
|
|
(this->_velocity).x = g_vectorZero.x;
|
|
(this->_velocity).y = g_vectorZero.y;
|
|
this->_flags = 0;
|
|
this->_entity = (void *)0x0;
|
|
return this;
|
|
}
|
|
|
|
// 00499960
|
|
EntityRef * EntityRef::operator_(EntityRef *other)
|
|
{
|
|
this->_type = other->_type;
|
|
this->_variant = other->_variant;
|
|
this->_spawnerType = other->_spawnerType;
|
|
this->_spawnerVariant = other->_spawnerVariant;
|
|
(this->_position).x = (other->_position).x;
|
|
(this->_position).y = (other->_position).y;
|
|
(this->_velocity).x = (other->_velocity).x;
|
|
(this->_velocity).y = (other->_velocity).y;
|
|
this->_flags = other->_flags;
|
|
this->_entity = other->_entity;
|
|
return this;
|
|
}
|
|
|
|
// 004a2910
|
|
uint32_t EntityRef::IsFriendly()
|
|
{
|
|
return CONCAT31((uint3)(GHIDRA_UINT(this->_flags) >> 9),(char)(GHIDRA_UINT(this->_flags) >> 1)) & 0xffffff01;
|
|
}
|
|
|
|
// 004bc670
|
|
uint8_t EntityRef::IsCharmed()
|
|
{
|
|
return (uint8_t)this->_flags & 1;
|
|
}
|