error on missing builtin functions

This commit is contained in:
quaK 2023-01-16 20:11:06 +02:00
parent 92e5479b45
commit e4fac2e445

View File

@ -131,9 +131,18 @@ namespace gsc
const auto function_id = get_function_id(); const auto function_id = get_function_id();
if (!functions.contains(function_id)) if (!functions.contains(function_id))
{
if (function == nullptr)
{
force_error_print = true;
gsc_error_msg = "function doesn't exist";
game::Scr_ErrorInternal();
}
else
{ {
function(); function();
} }
}
else else
{ {
execute_custom_function(function_id); execute_custom_function(function_id);
@ -152,9 +161,18 @@ namespace gsc
const auto function_id = get_function_id(); const auto function_id = get_function_id();
if (!methods.contains(function_id)) if (!methods.contains(function_id))
{
if (method == nullptr)
{
force_error_print = true;
gsc_error_msg = "method doesn't exist";
game::Scr_ErrorInternal();
}
else
{ {
method(saved_ent_ref); method(saved_ent_ref);
} }
}
else else
{ {
execute_custom_method(function_id); execute_custom_method(function_id);