diff options
author | aap <aap@papnet.eu> | 2019-07-08 08:46:42 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-07-08 08:46:42 +0200 |
commit | 12af85ca3d29e155f40323ad07a77f96a4aececf (patch) | |
tree | 7a6d7c8ed51ec1c527903835bbe4ee39eef2ab8b /src/peds/CivilianPed.cpp | |
parent | 6ec421fe7bc683e0d056d2a1b9d0bd0d159cf8e3 (diff) |
cleaned up patching of virtual functions; started CAutomobile
Diffstat (limited to 'src/peds/CivilianPed.cpp')
-rw-r--r-- | src/peds/CivilianPed.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/peds/CivilianPed.cpp b/src/peds/CivilianPed.cpp index a4881e71..cf8a0580 100644 --- a/src/peds/CivilianPed.cpp +++ b/src/peds/CivilianPed.cpp @@ -13,7 +13,14 @@ CCivilianPed::CCivilianPed(int pedtype, int mi) : CPed(pedtype) } } +class CCivilianPed_ : public CCivilianPed +{ +public: + CCivilianPed *ctor(int pedtype, int mi) { return ::new (this) CCivilianPed(pedtype, mi); }; + void dtor(void) { CCivilianPed::~CCivilianPed(); } +}; + STARTPATCHES - InjectHook(0x4BFF30, &CCivilianPed::ctor, PATCH_JUMP); - InjectHook(0x4BFFC0, &CCivilianPed::dtor, PATCH_JUMP); -ENDPATCHES
\ No newline at end of file + InjectHook(0x4BFF30, &CCivilianPed_::ctor, PATCH_JUMP); + InjectHook(0x4BFFC0, &CCivilianPed_::dtor, PATCH_JUMP); +ENDPATCHES |