From 12af85ca3d29e155f40323ad07a77f96a4aececf Mon Sep 17 00:00:00 2001 From: aap Date: Mon, 8 Jul 2019 08:46:42 +0200 Subject: cleaned up patching of virtual functions; started CAutomobile --- src/core/Placeable.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/core/Placeable.cpp') diff --git a/src/core/Placeable.cpp b/src/core/Placeable.cpp index b4b2a37b..c1fe705e 100644 --- a/src/core/Placeable.cpp +++ b/src/core/Placeable.cpp @@ -63,9 +63,17 @@ CPlaceable::IsWithinArea(float x1, float y1, float z1, float x2, float y2, float z1 <= GetPosition().z && GetPosition().z <= z2; } +class CPlaceable_ : public CPlaceable +{ +public: + CPlaceable *ctor(void) { return ::new (this) CPlaceable(); } + void dtor(void) { CPlaceable::~CPlaceable(); } +}; + STARTPATCHES - InjectHook(0x49F9A0, &CPlaceable::ctor, PATCH_JUMP); - InjectHook(0x49F9E0, &CPlaceable::dtor, PATCH_JUMP); + InjectHook(0x49F9A0, &CPlaceable_::ctor, PATCH_JUMP); + InjectHook(0x49F9E0, &CPlaceable_::dtor, PATCH_JUMP); + InjectHook(0x49FA00, &CPlaceable::SetHeading, PATCH_JUMP); InjectHook(0x49FA50, (bool (CPlaceable::*)(float, float, float, float))&CPlaceable::IsWithinArea, PATCH_JUMP); InjectHook(0x49FAF0, (bool (CPlaceable::*)(float, float, float, float, float, float))&CPlaceable::IsWithinArea, PATCH_JUMP); -- cgit v1.2.3