diff --git a/src/codsrc/clientscript/cscr_parser.cpp b/src/codsrc/clientscript/cscr_parser.cpp index e6f1d24..792dca8 100644 --- a/src/codsrc/clientscript/cscr_parser.cpp +++ b/src/codsrc/clientscript/cscr_parser.cpp @@ -723,7 +723,19 @@ namespace codsrc { if (game::Scr_IsInOpcodeMemory(scriptInstance, codepos - 1)) { - game::Com_PrintMessage(channel, game::va("@ %d\n", codepos - game::gScrVarPub[scriptInstance].programBuffer), 0); + // pluto + const char* s; + if (game::plutonium::at_codepose_va != nullptr) + { + s = game::plutonium::at_codepose_va(scriptInstance, codepos - game::gScrVarPub[scriptInstance].programBuffer); + } + else + { + s = game::va("@ %d\n", codepos - game::gScrVarPub[scriptInstance].programBuffer); + } + + game::Com_PrintMessage(channel, s, 0); + // return; } } diff --git a/src/codsrc/clientscript/cscr_vm.cpp b/src/codsrc/clientscript/cscr_vm.cpp index 3d34e36..3c25670 100644 --- a/src/codsrc/clientscript/cscr_vm.cpp +++ b/src/codsrc/clientscript/cscr_vm.cpp @@ -1678,7 +1678,20 @@ namespace codsrc Com_Printf(game::CON_CHANNEL_PARSERSCRIPT, "EXCEED TIME: %d\n", v28); }*/ - if (!game::gScrVmGlob[inst].loading) + // pluto + static game::dvar_s* scr_kill_infinite_loops = nullptr; + if (!scr_kill_infinite_loops) + { + scr_kill_infinite_loops = game::Dvar_FindVar("scr_kill_infinite_loops"); + } + + bool kill_infinite_loops = scr_kill_infinite_loops && scr_kill_infinite_loops->current.enabled; + // + + // if (!game::gScrVmGlob[inst].loading) + // pluto + if (kill_infinite_loops) + // { /*if (always_false()) { @@ -1699,7 +1712,10 @@ namespace codsrc Scr_Error(inst, "potential infinite loop in script", 0); }*/ - if (!game::gScrVmPub[inst].abort_on_error) + //if (!game::gScrVmPub[inst].abort_on_error) + // pluto + if (kill_infinite_loops) + // { // t5 added this extra string const char* side = inst == game::SCRIPTINSTANCE_CLIENT ? "client" : "server"; @@ -5440,7 +5456,24 @@ namespace codsrc { game::Scr_SetErrorMessage(inst, error); - game::gScrVmPub[inst].terminal_error = is_terminal; + // pluto + if (is_terminal) + { + game::gScrVmPub[inst].terminal_error = is_terminal; + } + + static game::dvar_s* all_gsc_errors_non_terminal = nullptr; + if (!all_gsc_errors_non_terminal) + { + all_gsc_errors_non_terminal = game::Dvar_FindVar("all_gsc_errors_non_terminal"); + } + + if (all_gsc_errors_non_terminal && all_gsc_errors_non_terminal->current.enabled) + { + game::gScrVmPub[inst].terminal_error = false; + } + // + game::Scr_ErrorInternal(inst); } @@ -5449,7 +5482,7 @@ namespace codsrc { game::Scr_DumpScriptThreads(inst); game::gScrVmPub[inst].terminal_error = 1; - game::Scr_Error(error, inst, false); + game::Scr_Error(error, inst, false); // yes, this is a basegame bug, pluto fixes it above } // Decomp Status: Tested, Completed diff --git a/src/component/signatures.cpp b/src/component/signatures.cpp index 901ab37..179e615 100644 --- a/src/component/signatures.cpp +++ b/src/component/signatures.cpp @@ -209,6 +209,7 @@ namespace signatures SAFE_SET_PLUTO_SYMBOL_DOUBLE(scr_execthread_update_codepos_func, 0x699560, 0x11); SAFE_SET_PLUTO_SYMBOL_DOUBLE(scr_execentthread_update_codepos_func, 0x699640, 0x7); SAFE_SET_PLUTO_SYMBOL_DOUBLE(scr_addexecthread_update_codepos_func, 0x699730, 0x7); + SAFE_SET_PLUTO_SYMBOL_DOUBLE(at_codepose_va, 0x68B3A5, 0xA); SAFE_SET_PLUTO_SYMBOL(scr_get_function_stub, 0x682D99); SAFE_SET_PLUTO_SYMBOL(scr_get_method_stub, 0x683043); diff --git a/src/game/symbols.hpp b/src/game/symbols.hpp index 7311db5..4bdee7e 100644 --- a/src/game/symbols.hpp +++ b/src/game/symbols.hpp @@ -20,6 +20,8 @@ namespace game WEAK symbolva{ 0x0, 0x5F6D80 }; + WEAK symbolDvar_FindVar{ 0x0, 0x5EDE30 }; + WEAK symbolCom_BeginParseSession{ 0x0, 0x5F5830 }; WEAK symbol Com_EndParseSession{ 0x0, 0x5F5910 }; WEAK symbol Sys_Milliseconds{ 0x0, 0x603D40 }; @@ -79,6 +81,8 @@ namespace game WEAK symbol scr_execentthread_update_codepos_func{ 0x0, 0x0 }; WEAK symbol scr_addexecthread_update_codepos_func{ 0x0, 0x0 }; + WEAK symbol at_codepose_va{ 0x0, 0x0 }; + WEAK symbol scr_get_method_stub{ 0x0, 0x0 }; WEAK symbol scr_get_function_stub{ 0x0, 0x0 }; }