2019-06-18 07:50:26 +00:00
|
|
|
#include "common.h"
|
|
|
|
#include "patcher.h"
|
|
|
|
#include "DummyObject.h"
|
|
|
|
#include "Pools.h"
|
|
|
|
|
|
|
|
CDummyObject::CDummyObject(CObject *obj)
|
|
|
|
{
|
|
|
|
SetModelIndexNoCreate(obj->GetModelIndex());
|
|
|
|
if(obj->m_rwObject)
|
|
|
|
AttachToRwObject(obj->m_rwObject);
|
|
|
|
obj->DetachFromRwObject();
|
|
|
|
m_level = obj->m_level;
|
|
|
|
}
|
2019-06-30 10:59:55 +00:00
|
|
|
|
2019-07-08 06:46:42 +00:00
|
|
|
class CDummyObject_ : public CDummyObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void dtor(void) { CDummyObject::~CDummyObject(); }
|
2020-03-07 19:22:43 +00:00
|
|
|
CDummyObject *ctor(void) { return ::new (this) CDummyObject(); }
|
|
|
|
CDummyObject *ctor(CObject *obj) { return ::new (this) CDummyObject(obj); }
|
2019-07-08 06:46:42 +00:00
|
|
|
};
|
|
|
|
|
2019-06-30 10:59:55 +00:00
|
|
|
STARTPATCHES
|
2020-03-07 19:22:43 +00:00
|
|
|
InjectHook(0x4BAAF0, (CDummyObject* (CDummyObject::*)(void)) &CDummyObject_::ctor, PATCH_JUMP);
|
|
|
|
InjectHook(0x4BAB10, (CDummyObject* (CDummyObject::*)(CObject*)) &CDummyObject_::ctor, PATCH_JUMP);
|
2019-07-08 06:46:42 +00:00
|
|
|
InjectHook(0x4BAB70, &CDummyObject_::dtor, PATCH_JUMP);
|
2020-03-07 19:22:43 +00:00
|
|
|
ENDPATCHES
|