[saco] Implement/match CGame::SetModelDeletable(...)

This commit is contained in:
RD42 2024-08-15 22:27:48 +08:00
parent 572c53d887
commit 3bad4d20c2
2 changed files with 42 additions and 1 deletions

View File

@ -492,7 +492,47 @@ BOOL CGame::IsModelLoaded(int iModelID)
}
//-----------------------------------------------------------
// MATCH
BOOL CGame::SetModelDeletable(int iModelID)
{
BYTE * pStreamingModelInfo = (BYTE*)(iModelID * 20);
if(IsModelLoaded(iModelID))
return TRUE;
_asm push 2
_asm push iModelID
_asm mov edx, 0x4087E0 ; CStreaming__RequestModel
_asm call edx
_asm pop edx
_asm pop edx
_asm push 0
_asm mov edx, 0x40EA10 ; CStreaming__LoadAllRequestedModels
_asm call edx
_asm pop edx
if(*(pStreamingModelInfo + 0x8E4CD0) == 1)
{
if(*(pStreamingModelInfo + 0x8E4CC6) & 2)
{
_asm push iModelID
_asm mov edx, 0x409C10 ; CStreaming__SetModelIsDeletable
_asm call edx
_asm pop edx
_asm push iModelID
_asm mov edx, 0x409C70 ; CStreaming__SetModelTxdIsDeletable
_asm call edx
_asm pop edx
}
return TRUE;
}
return FALSE;
}
//-----------------------------------------------------------
void CGame::SetWorldTime(int iHour, int iMinute)
{
*(PBYTE)0xB70152 = (BYTE)iMinute;

View File

@ -47,6 +47,7 @@ public:
void RequestModel(int iModelID, int iLoadingStream = 2);
void LoadRequestedModels();
BOOL IsModelLoaded(int iModelID);
BOOL SetModelDeletable(int iModelID);
void SetWorldTime(int iHour, int iMinute);
void GetWorldTime(BYTE* byteHour, BYTE* byteMinute);