implemented cHandlingDataMgr

This commit is contained in:
aap
2019-06-19 23:41:43 +02:00
parent 2ec11b000d
commit 2fcdf6fa21
8 changed files with 457 additions and 5 deletions

View File

@@ -1,7 +1,26 @@
#include "common.h"
#include "rpworld.h"
#include "patcher.h"
#include "Building.h"
#include "Streaming.h"
#include "Pools.h"
void *CBuilding::operator new(size_t sz) { return CPools::GetBuildingPool()->New(); }
void CBuilding::operator delete(void *p, size_t sz) { CPools::GetBuildingPool()->Delete((CBuilding*)p); }
void
CBuilding::ReplaceWithNewModel(int32 id)
{
DeleteRwObject();
if(CModelInfo::GetModelInfo(m_modelIndex)->m_refCount == 0)
CStreaming::RemoveModel(m_modelIndex);
m_modelIndex = id;
if(bIsBIGBuilding)
if(m_level == LEVEL_NONE || m_level == CGame::currLevel)
CStreaming::RequestModel(id, STREAM_DONT_REMOVE);
}
STARTPATCHES
InjectHook(0x405850, &CBuilding::ReplaceWithNewModel, PATCH_JUMP);
ENDPATCHES