summaryrefslogtreecommitdiffstats
path: root/src/objects/Object.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/objects/Object.cpp42
1 files changed, 4 insertions, 38 deletions
diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp
index 867624c7..8968c117 100644
--- a/src/objects/Object.cpp
+++ b/src/objects/Object.cpp
@@ -1,5 +1,5 @@
#include "common.h"
-#include "patcher.h"
+
#include "main.h"
#include "Lights.h"
#include "Pools.h"
@@ -12,8 +12,8 @@
#include "World.h"
#include "Floater.h"
-int16 &CObject::nNoTempObjects = *(int16*)0x95CCA2;
-int16 &CObject::nBodyCastHealth = *(int16*)0x5F7D4C; // 1000
+int16 CObject::nNoTempObjects;
+int16 CObject::nBodyCastHealth = 1000;
void *CObject::operator new(size_t sz) { return CPools::GetObjectPool()->New(); }
void *CObject::operator new(size_t sz, int handle) { return CPools::GetObjectPool()->New(handle);};
@@ -383,7 +383,7 @@ CObject::DeleteAllTempObjects()
}
void
-CObject::DeleteAllTempObjectInArea(CVector point, float fRadius)
+CObject::DeleteAllTempObjectsInArea(CVector point, float fRadius)
{
CObjectPool *objectPool = CPools::GetObjectPool();
for (int32 i = 0; i < objectPool->GetSize(); i++) {
@@ -394,37 +394,3 @@ CObject::DeleteAllTempObjectInArea(CVector point, float fRadius)
}
}
}
-
-#include <new>
-
-class CObject_ : public CObject
-{
-public:
- CObject *ctor(void) { return ::new (this) CObject(); }
- CObject *ctor(int32 mi, bool createRW) { return ::new (this) CObject(mi, createRW); }
- CObject *ctor(CDummyObject *dummy) { return ::new (this) CObject(dummy); }
- void dtor(void) { CObject::~CObject(); }
- void Render_(void) { CObject::Render(); }
- void ProcessControl_(void) { CObject::ProcessControl(); }
- bool SetupLighting_(void) { return CObject::SetupLighting(); }
- void RemoveLighting_(bool reset) { CObject::RemoveLighting(reset); }
-};
-
-STARTPATCHES
- InjectHook(0x4BABD0, (CObject* (CObject::*)(void)) &CObject_::ctor, PATCH_JUMP);
- InjectHook(0x4BACE0, (CObject* (CObject::*)(int32, bool)) &CObject_::ctor, PATCH_JUMP);
- InjectHook(0x4BAD50, (CObject* (CObject::*)(CDummyObject*)) &CObject_::ctor, PATCH_JUMP);
- InjectHook(0x4BAE00, &CObject_::dtor, PATCH_JUMP);
- InjectHook(0x4BB040, &CObject_::ProcessControl_, PATCH_JUMP);
- InjectHook(0x4BBDA0, &CObject::Teleport, PATCH_JUMP);
- InjectHook(0x4BB1E0, &CObject_::Render_, PATCH_JUMP);
- InjectHook(0x4A7C90, &CObject_::SetupLighting_, PATCH_JUMP);
- InjectHook(0x4A7CD0, &CObject_::RemoveLighting_, PATCH_JUMP);
- InjectHook(0x4BB240, &CObject::ObjectDamage, PATCH_JUMP);
- InjectHook(0x4BBD80, &CObject::RefModelInfo, PATCH_JUMP);
- InjectHook(0x4BAEC0, &CObject::Init, PATCH_JUMP);
- InjectHook(0x4BB010, &CObject::CanBeDeleted, PATCH_JUMP);
- InjectHook(0x4BBE60, &CObject::DeleteAllMissionObjects, PATCH_JUMP);
- InjectHook(0x4BBDF0, &CObject::DeleteAllTempObjects, PATCH_JUMP);
- InjectHook(0x4BBED0, &CObject::DeleteAllTempObjectInArea, PATCH_JUMP);
-ENDPATCHES