mirror of
https://github.com/fedddddd/iw5-gsc-utils.git
synced 2025-05-20 10:54:52 +00:00
Fix setjmp
This commit is contained in:
parent
0f92a7ce25
commit
e6ca925562
@ -109,8 +109,6 @@ namespace userinfo
|
|||||||
|
|
||||||
gsc::method::add("resetname", [](const game::scr_entref_t ent, const gsc::function_args& args) -> scripting::script_value
|
gsc::method::add("resetname", [](const game::scr_entref_t ent, const gsc::function_args& args) -> scripting::script_value
|
||||||
{
|
{
|
||||||
const auto name = args[0].as<std::string>();
|
|
||||||
|
|
||||||
if (ent.classnum != 0 || ent.entnum > 17)
|
if (ent.classnum != 0 || ent.entnum > 17)
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Invalid entity");
|
throw std::runtime_error("Invalid entity");
|
||||||
@ -141,8 +139,6 @@ namespace userinfo
|
|||||||
|
|
||||||
gsc::method::add("resetclantag", [](const game::scr_entref_t ent, const gsc::function_args& args) -> scripting::script_value
|
gsc::method::add("resetclantag", [](const game::scr_entref_t ent, const gsc::function_args& args) -> scripting::script_value
|
||||||
{
|
{
|
||||||
const auto name = args[0].as<std::string>();
|
|
||||||
|
|
||||||
if (ent.classnum != 0 || ent.entnum > 17)
|
if (ent.classnum != 0 || ent.entnum > 17)
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Invalid entity");
|
throw std::runtime_error("Invalid entity");
|
||||||
|
@ -25,7 +25,7 @@ namespace scripting::safe_execution
|
|||||||
bool call(const script_function function, const game::scr_entref_t& entref)
|
bool call(const script_function function, const game::scr_entref_t& entref)
|
||||||
{
|
{
|
||||||
*game::g_script_error_level += 1;
|
*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;
|
*game::g_script_error_level -= 1;
|
||||||
return false;
|
return false;
|
||||||
@ -39,7 +39,7 @@ namespace scripting::safe_execution
|
|||||||
bool set_entity_field(const game::scr_entref_t& entref, const int offset)
|
bool set_entity_field(const game::scr_entref_t& entref, const int offset)
|
||||||
{
|
{
|
||||||
*game::g_script_error_level += 1;
|
*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;
|
*game::g_script_error_level -= 1;
|
||||||
return false;
|
return false;
|
||||||
@ -54,7 +54,7 @@ namespace scripting::safe_execution
|
|||||||
bool get_entity_field(const game::scr_entref_t& entref, const int offset, game::VariableValue* value)
|
bool get_entity_field(const game::scr_entref_t& entref, const int offset, game::VariableValue* value)
|
||||||
{
|
{
|
||||||
*game::g_script_error_level += 1;
|
*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->type = game::SCRIPT_NONE;
|
||||||
value->u.intValue = 0;
|
value->u.intValue = 0;
|
||||||
|
@ -62,7 +62,7 @@ namespace game
|
|||||||
WEAK symbol<unsigned int(unsigned int localId, const char* pos, unsigned int paramcount)> VM_Execute{0x56DFE0};
|
WEAK symbol<unsigned int(unsigned int localId, const char* pos, unsigned int paramcount)> VM_Execute{0x56DFE0};
|
||||||
|
|
||||||
WEAK symbol<void* (jmp_buf* Buf, int Value)> longjmp{0x7363BC};
|
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
|
// Variables
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user