r5sdk/r5dev/squirrel/sqstdaux.cpp

42 lines
1.0 KiB
C++
Raw Normal View History

//=============================================================================//
//
// Purpose:
//
//=============================================================================//
#include "core/stdafx.h"
#include "tier0/tslist.h"
#include "squirrel/sqvm.h"
#include "squirrel/sqstdaux.h"
bool g_bSQAuxError = false;
2022-05-20 01:16:30 +02:00
bool g_bSQAuxBadLogic = false;
HSQUIRRELVM g_pErrorVM = nullptr;
SQInteger sqstd_aux_printerror(HSQUIRRELVM v)
{
g_bSQAuxError = true;
SQInteger results = v_sqstd_aux_printerror(v);
g_bSQAuxError = false;
return results;
}
2022-05-20 01:12:05 +02:00
SQInteger sqstd_aux_badlogic(HSQUIRRELVM v, __m128i* a2, __m128i* a3)
2022-05-20 01:07:42 +02:00
{
g_pErrorVM = v;
2022-05-20 01:12:05 +02:00
SQInteger results = v_sqstd_aux_badlogic(v, a2, a3);
2022-05-20 01:07:42 +02:00
return results;
}
void VSqStdAux::Attach() const
{
DetourAttach(&v_sqstd_aux_printerror, &sqstd_aux_printerror);
DetourAttach(&v_sqstd_aux_badlogic, &sqstd_aux_badlogic);
}
void VSqStdAux::Detach() const
{
DetourDetach(&v_sqstd_aux_printerror, &sqstd_aux_printerror);
DetourDetach(&v_sqstd_aux_badlogic, &sqstd_aux_badlogic);
}