Skip to content

Commit

Permalink
Fix setjmp
Browse files Browse the repository at this point in the history
  • Loading branch information
alicealys committed Nov 15, 2021
1 parent e6381e5 commit ffd47ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/game/scripting/safe_execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace scripting::safe_execution
bool call(const script_function function, const game::scr_entref_t& entref)
{
*game::g_script_error_level += 1;
if (game::_setjmp(&game::g_script_error[*game::g_script_error_level]))
if (game::_setjmp(&game::g_script_error[*game::g_script_error_level], 0, 0, 0))
{
*game::g_script_error_level -= 1;
return false;
Expand All @@ -39,7 +39,7 @@ namespace scripting::safe_execution
bool set_entity_field(const game::scr_entref_t& entref, const int offset)
{
*game::g_script_error_level += 1;
if (game::_setjmp(&game::g_script_error[*game::g_script_error_level]))
if (game::_setjmp(&game::g_script_error[*game::g_script_error_level], 0, 0, 0))
{
*game::g_script_error_level -= 1;
return false;
Expand All @@ -54,7 +54,7 @@ namespace scripting::safe_execution
bool get_entity_field(const game::scr_entref_t& entref, const int offset, game::VariableValue* value)
{
*game::g_script_error_level += 1;
if (game::_setjmp(&game::g_script_error[*game::g_script_error_level]))
if (game::_setjmp(&game::g_script_error[*game::g_script_error_level], 0, 0, 0))
{
value->type = game::SCRIPT_NONE;
value->u.intValue = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/game/symbols.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace game
WEAK symbol<unsigned int(unsigned int localId, unsigned int pos, unsigned int paramcount)> VM_Execute{0x56DFE0};

WEAK symbol<void*(jmp_buf* Buf, int Value)> longjmp{0x7363BC};
WEAK symbol<int(jmp_buf* Buf)> _setjmp{0x734CF8};
WEAK symbol<int(jmp_buf* Buf, int a2, int a3, int a4)> _setjmp{0x734CF8};

// Variables

Expand Down

0 comments on commit ffd47ce

Please sign in to comment.