summaryrefslogtreecommitdiffstats
path: root/src/modelinfo/ModelInfo.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-06-28 19:23:28 +0200
committeraap <aap@papnet.eu>2019-06-28 19:23:28 +0200
commit48cf8b6629da53443be6b1580ee15ad768c53370 (patch)
treed6bdeb18130b49096a995789840faf382f68f7ee /src/modelinfo/ModelInfo.cpp
parentMerge pull request #67 from gennariarmando/master (diff)
downloadre3-48cf8b6629da53443be6b1580ee15ad768c53370.tar
re3-48cf8b6629da53443be6b1580ee15ad768c53370.tar.gz
re3-48cf8b6629da53443be6b1580ee15ad768c53370.tar.bz2
re3-48cf8b6629da53443be6b1580ee15ad768c53370.tar.lz
re3-48cf8b6629da53443be6b1580ee15ad768c53370.tar.xz
re3-48cf8b6629da53443be6b1580ee15ad768c53370.tar.zst
re3-48cf8b6629da53443be6b1580ee15ad768c53370.zip
Diffstat (limited to 'src/modelinfo/ModelInfo.cpp')
-rw-r--r--src/modelinfo/ModelInfo.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/modelinfo/ModelInfo.cpp b/src/modelinfo/ModelInfo.cpp
index acc40824..454a73f1 100644
--- a/src/modelinfo/ModelInfo.cpp
+++ b/src/modelinfo/ModelInfo.cpp
@@ -175,6 +175,23 @@ CModelInfo::IsBoatModel(int32 id)
((CVehicleModelInfo*)GetModelInfo(id))->m_vehicleType == VEHICLE_TYPE_BOAT;
}
+void
+CModelInfo::RemoveColModelsFromOtherLevels(eLevelName level)
+{
+ int i;
+ CBaseModelInfo *mi;
+ CColModel *colmodel;
+
+ for(i = 0; i < MODELINFOSIZE; i++){
+ mi = GetModelInfo(i);
+ if(mi){
+ colmodel = mi->GetColModel();
+ if(colmodel && colmodel->level != LEVEL_NONE && colmodel->level != level)
+ colmodel->RemoveCollisionVolumes();
+ }
+ }
+}
+
STARTPATCHES
InjectHook(0x50B310, CModelInfo::Initialise, PATCH_JUMP);
InjectHook(0x50B5B0, CModelInfo::ShutDown, PATCH_JUMP);
@@ -184,4 +201,5 @@ STARTPATCHES
InjectHook(0x50BAD0, CModelInfo::AddPedModel, PATCH_JUMP);
InjectHook(0x50BA60, CModelInfo::AddVehicleModel, PATCH_JUMP);
InjectHook(0x50B860, (CBaseModelInfo *(*)(const char*, int*))CModelInfo::GetModelInfo, PATCH_JUMP);
+ InjectHook(0x50BBC0, CModelInfo::RemoveColModelsFromOtherLevels, PATCH_JUMP);
ENDPATCHES