diff options
author | aap <aap@papnet.eu> | 2019-06-24 22:06:14 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2019-06-24 22:06:14 +0200 |
commit | 3b43c0957893e06f832f2097225ae83b09f86199 (patch) | |
tree | 421a6083b469dbce38531a128db1f5dd5a5a6174 | |
parent | fixed bug in CPlaceable (diff) | |
download | re3-3b43c0957893e06f832f2097225ae83b09f86199.tar re3-3b43c0957893e06f832f2097225ae83b09f86199.tar.gz re3-3b43c0957893e06f832f2097225ae83b09f86199.tar.bz2 re3-3b43c0957893e06f832f2097225ae83b09f86199.tar.lz re3-3b43c0957893e06f832f2097225ae83b09f86199.tar.xz re3-3b43c0957893e06f832f2097225ae83b09f86199.tar.zst re3-3b43c0957893e06f832f2097225ae83b09f86199.zip |
-rw-r--r-- | src/FileLoader.cpp | 7 | ||||
-rw-r--r-- | src/entities/Building.cpp | 1 | ||||
-rw-r--r-- | src/entities/Building.h | 2 | ||||
-rw-r--r-- | src/entities/Entity.cpp | 5 | ||||
-rw-r--r-- | src/entities/Entity.h | 1 |
5 files changed, 11 insertions, 5 deletions
diff --git a/src/FileLoader.cpp b/src/FileLoader.cpp index f50638b4..dd58614d 100644 --- a/src/FileLoader.cpp +++ b/src/FileLoader.cpp @@ -501,7 +501,7 @@ CFileLoader::LoadObjectTypes(const char *filename) CARS, PEDS, PATH, - TWO2FX + TWODFX }; char *line; int fd; @@ -528,7 +528,7 @@ CFileLoader::LoadObjectTypes(const char *filename) else if(strncmp(line, "cars", 4) == 0) section = CARS; else if(strncmp(line, "peds", 4) == 0) section = PEDS; else if(strncmp(line, "path", 4) == 0) section = PATH; - else if(strncmp(line, "2dfx", 4) == 0) section = TWO2FX; + else if(strncmp(line, "2dfx", 4) == 0) section = TWODFX; }else if(strncmp(line, "end", 3) == 0){ section = section == MLO ? OBJS : NONE; }else switch(section){ @@ -571,7 +571,7 @@ CFileLoader::LoadObjectTypes(const char *filename) pathIndex = -1; } break; - case TWO2FX: + case TWODFX: Load2dEffect(line); break; } @@ -848,6 +848,7 @@ CFileLoader::LoadCarPathNode(const char *line, int id, int node) ThePaths.StoreNodeInfoCar(id, node, type, next, x, y, z, 0, numLeft, numRight); } + void CFileLoader::Load2dEffect(const char *line) { diff --git a/src/entities/Building.cpp b/src/entities/Building.cpp index 9e56b3a2..d69a65fe 100644 --- a/src/entities/Building.cpp +++ b/src/entities/Building.cpp @@ -22,5 +22,6 @@ CBuilding::ReplaceWithNewModel(int32 id) } STARTPATCHES + InjectHook(0x4057D0, &CBuilding::ctor, PATCH_JUMP); InjectHook(0x405850, &CBuilding::ReplaceWithNewModel, PATCH_JUMP); ENDPATCHES diff --git a/src/entities/Building.h b/src/entities/Building.h index 7b837f46..b1f96bae 100644 --- a/src/entities/Building.h +++ b/src/entities/Building.h @@ -15,5 +15,7 @@ public: void ReplaceWithNewModel(int32 id); virtual bool GetIsATreadable(void) { return false; } + + CBuilding *ctor(void) { return ::new (this) CBuilding(); } }; static_assert(sizeof(CBuilding) == 0x64, "CBuilding: error"); diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp index d2b2577d..294518c8 100644 --- a/src/entities/Entity.cpp +++ b/src/entities/Entity.cpp @@ -339,9 +339,9 @@ CEntity::GetBoundRect(void) return rect; } -void +WRAPPER void CEntity::PreRender(void) -{ +{ EAXJMP(0x474350); } void @@ -448,6 +448,7 @@ CEntity::PruneReferences(void) } STARTPATCHES + InjectHook(0x473C30, &CEntity::ctor, PATCH_JUMP); InjectHook(0x4742C0, (void (CEntity::*)(CVector&))&CEntity::GetBoundCentre, PATCH_JUMP); InjectHook(0x474310, &CEntity::GetBoundRadius, PATCH_JUMP); InjectHook(0x474C10, &CEntity::GetIsTouching, PATCH_JUMP); diff --git a/src/entities/Entity.h b/src/entities/Entity.h index 0ce47428..8816e206 100644 --- a/src/entities/Entity.h +++ b/src/entities/Entity.h @@ -155,6 +155,7 @@ public: // to make patching virtual functions possible + CEntity *ctor(void) { return ::new (this) CEntity(); } void Add_(void) { CEntity::Add(); } void Remove_(void) { CEntity::Remove(); } void CreateRwObject_(void) { CEntity::CreateRwObject(); } |