1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-14 06:59:16 +00:00
re3/src/modelinfo/TimeModelInfo.cpp

37 lines
732 B
C++
Raw Normal View History

2019-05-15 14:52:37 +00:00
#include "common.h"
#include "patcher.h"
#include "Camera.h"
#include "ModelInfo.h"
CTimeModelInfo*
CTimeModelInfo::FindOtherTimeModel(void)
{
char name[40];
char *p;
int i;
strcpy(name, GetName());
// change _nt to _dy
if(p = strstr(name, "_nt"))
strncpy(p, "_dy", 4);
// change _dy to _nt
else if(p = strstr(name, "_dy"))
strncpy(p, "_nt", 4);
else
return nil;
for(i = 0; i < MODELINFOSIZE; i++){
CBaseModelInfo *mi = CModelInfo::GetModelInfo(i);
if(mi && mi->m_type == MITYPE_TIME &&
strncmp(name, mi->GetName(), 24) == 0){
m_otherTimeModelID = i;
return (CTimeModelInfo*)mi;
}
}
return nil;
}
STARTPATCHES
InjectHook(0x517C80, &CTimeModelInfo::FindOtherTimeModel, PATCH_JUMP);
ENDPATCHES