mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Utilize the new IDetour::DetourSetup() code, IDetour::Attach and IDetour::Detach have been removed in favor of this (significantly reduces chance of user error). Since the template check happens in the idetour header, it is much more aggressive on type mismatches, such as a difference in parameter types, between the function and detour, will now raise a compile time error. As a result, some type mismatches have been fixed in this commit as well.
26 lines
841 B
C++
26 lines
841 B
C++
//=============================================================================//
|
|
//
|
|
// Purpose:
|
|
//
|
|
// $NoKeywords: $
|
|
//=============================================================================//
|
|
#include "core/stdafx.h"
|
|
#include "public/studio.h"
|
|
#include "game/shared/animation.h"
|
|
|
|
//-----------------------------------------------------------------------------
|
|
//
|
|
//-----------------------------------------------------------------------------
|
|
int CStudioHdr::LookupSequence(CStudioHdr* pStudio, const char* pszName)
|
|
{
|
|
if (!pStudio->m_pMDLCache)
|
|
return -1; // animations are unavailable for missing dynamic props! (mdl/error.rmdl).
|
|
|
|
return v_CStudioHdr__LookupSequence(pStudio, pszName);
|
|
}
|
|
|
|
void VAnimation::Detour(const bool bAttach) const
|
|
{
|
|
DetourSetup(&v_CStudioHdr__LookupSequence, &CStudioHdr::LookupSequence, bAttach);
|
|
}
|