mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-05-09 21:54:53 +00:00
Reenable c++ exceptions
This commit is contained in:
parent
623d0001a9
commit
93a9fd55d5
@ -103,8 +103,6 @@ workspace "t4sp-server-plugin"
|
|||||||
|
|
||||||
dependencies.imports()
|
dependencies.imports()
|
||||||
|
|
||||||
exceptionhandling ("Off")
|
|
||||||
|
|
||||||
if _OPTIONS["copy-to"] then
|
if _OPTIONS["copy-to"] then
|
||||||
postbuildcommands {"copy /y \"$(TargetPath)\" \"" .. _OPTIONS["copy-to"] .. "\""}
|
postbuildcommands {"copy /y \"$(TargetPath)\" \"" .. _OPTIONS["copy-to"] .. "\""}
|
||||||
else
|
else
|
||||||
|
@ -109,11 +109,12 @@ namespace codsrc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jmp_buf g_script_error[2][33];
|
|
||||||
|
|
||||||
// Completed
|
// Completed
|
||||||
void Scr_ErrorInternal(game::scriptInstance_t inst)
|
void Scr_ErrorInternal(game::scriptInstance_t inst)
|
||||||
{
|
{
|
||||||
|
std::string a = "OH NO";
|
||||||
|
printf("%s\n", a.c_str());
|
||||||
|
|
||||||
assert(game::gScrVarPub[inst].error_message);
|
assert(game::gScrVarPub[inst].error_message);
|
||||||
|
|
||||||
if ( !game::gScrVarPub[inst].evaluate && !game::gScrCompilePub[inst].script_loading )
|
if ( !game::gScrVarPub[inst].evaluate && !game::gScrCompilePub[inst].script_loading )
|
||||||
@ -126,8 +127,9 @@ namespace codsrc
|
|||||||
|
|
||||||
assert(game::g_script_error_level[inst] < 33);
|
assert(game::g_script_error_level[inst] < 33);
|
||||||
|
|
||||||
//game::longjmp((int*)game::g_script_error.get() + 0x10 * (0x21 * inst + game::g_script_error_level[inst]), -1);
|
// use game's longjmp so we can enable c++ exceptions in our project without crashing due to stack unwinding a c++ object
|
||||||
longjmp(g_script_error[inst][game::g_script_error_level[inst]], -1);
|
auto jmp_bufs = reinterpret_cast<jmp_buf(*)[2][33]>(game::g_script_error.get());
|
||||||
|
game::longjmp((*jmp_bufs)[inst][game::g_script_error_level[inst]], -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
game::Sys_Error("%s", game::gScrVarPub[inst].error_message);
|
game::Sys_Error("%s", game::gScrVarPub[inst].error_message);
|
||||||
@ -2387,8 +2389,9 @@ namespace codsrc
|
|||||||
assert(game::g_script_error_level[inst] >= 0);
|
assert(game::g_script_error_level[inst] >= 0);
|
||||||
assert(game::g_script_error_level[inst] < 33);
|
assert(game::g_script_error_level[inst] < 33);
|
||||||
assert(inst == 0 || inst == 1);
|
assert(inst == 0 || inst == 1);
|
||||||
//if (game::_setjmp3((int *)game::g_script_error.get() + 0x10 * (0x21 * inst + game::g_script_error_level[inst]), 0))
|
|
||||||
if (!setjmp(g_script_error[inst][game::g_script_error_level[inst]]))
|
auto jmp_bufs = reinterpret_cast<jmp_buf(*)[2][33]>(game::g_script_error.get());
|
||||||
|
if (!game::_setjmp3((*jmp_bufs)[inst][game::g_script_error_level[inst]], 0))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user