-
Автор темы
- #1
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Код:
template< typename F >
F vFun_Call(PVOID64 BaseClass, DWORD64 vIndex)
{
PDWORD64* vPointer = (PDWORD64*)BaseClass;
PDWORD64 vFunction = *vPointer;
DWORD64 dwAddress = vFunction[vIndex];
return (F)(dwAddress);
}
class IAnimationGraphState
{
public:
const char* GetCurrentStateName() {
typedef const char* (__thiscall* oFunc)(void*);
return vFun_Call<oFunc>(this, 256/8)(this);
}
};
class IActor
{
public:
IAnimationGraphState * GetAnimationGraphState()
{
typedef IAnimationGraphState* (__thiscall* oFunc)(void*);
return vFun_Call<oFunc>(this, 296/8 )(this);
}
}
C++:
bool IsDead(IActor* pActor)
{
if (CheckCurrentStateName(pActor, "Dead_"))
return 1;
else
return 0;
}
C++:
const char* GetCurrentStateName(IActor* pActor)
{
return pActor->GetAnimationGraphState()->GetCurrentStateName();
}
bool CheckCurrentStateName(IActor* pActor, const char* AnimationName)
{
if (miniCRT._strstr(GetCurrentStateName(pActor), AnimationName))
return 1;
else
return 0;
}
C++:
if (isVisible(LocBonePos))continue;
C++:
char * strstr(const char *source, const char *word)
{
const char *bp = word;
const char *back_pos;
while (*source != 0 && source != 0 && word != 0)
{
back_pos = source;
while (toupper(*back_pos++) == toupper(*word++))
{
if (*word == 0)
{
return (char*)(back_pos - _strlen(bp));
}
}
++source;
word = bp;
}
return 0;
}
Последнее редактирование: