mirror of
https://github.com/Ragora/T2-CPP.git
synced 2026-01-19 18:14:44 +00:00
* Add preprocessor macros for resolving member field offsets in a standard, easy to read way.
29 lines
720 B
C++
29 lines
720 B
C++
#include <DXAPI/Projectile.h>
|
|
|
|
namespace DX
|
|
{
|
|
Projectile::Projectile(unsigned int obj) : GameBase(obj),
|
|
velocity(MEMBER_POINT3F(obj, 892, 4)),
|
|
hidden(MEMBER_FIELD(obj, bool, 796))
|
|
{
|
|
}
|
|
|
|
void Projectile::explode(const Linker::Point3F &position, const Linker::Point3F &normal, const unsigned int collideType)
|
|
{
|
|
void *pointer = (void*)this->base_pointer_value;
|
|
|
|
typedef void (__cdecl *explodeFunc)(const Linker::Point3F &position, const Linker::Point3F &normal, const unsigned int collideType);
|
|
static explodeFunc function_call = (explodeFunc)0x62DC30;
|
|
|
|
__asm
|
|
{
|
|
push collideType;
|
|
push normal;
|
|
push position;
|
|
mov ecx,pointer;
|
|
lea eax, function_call;
|
|
mov eax, [eax];
|
|
call eax;
|
|
}
|
|
}
|
|
} |