Fix Crash with multilist

This commit is contained in:
GabsPuNs
2026-05-16 15:34:51 -04:00
parent e5ec448563
commit 341d4c8d6a

View File

@@ -1250,7 +1250,17 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
}
else if(wcscmp((wchar_t *)call->function_name.string,L"handleCheckboxToggled")==0)
{
if(call->num_arguments != 2)
if(call->num_arguments == 2)
{
if (call->arguments[0].type == IGGY_DATATYPE_number && call->arguments[1].type == IGGY_DATATYPE_boolean)
return handleCheckboxToggled(call->arguments[0].number, call->arguments[1].boolval);
}
else if(call->num_arguments == 3)
{
if (call->arguments[0].type == IGGY_DATATYPE_number && call->arguments[1].type == IGGY_DATATYPE_number && call->arguments[2].type == IGGY_DATATYPE_boolean)
return handleCheckboxToggled(call->arguments[0].number, call->arguments[2].boolval); //call->arguments[1].number
}
else
{
app.DebugPrintf("Callback for handleCheckboxToggled did not have the correct number of arguments\n");
#ifndef _CONTENT_PACKAGE
@@ -1258,19 +1268,26 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
#endif
return;
}
if(call->arguments[0].type != IGGY_DATATYPE_number || call->arguments[1].type != IGGY_DATATYPE_boolean)
{
app.DebugPrintf("Arguments for handleCheckboxToggled were not of the correct type\n");
app.DebugPrintf("Arguments for handleCheckboxToggled were not of the correct type\n");
#ifndef _CONTENT_PACKAGE
__debugbreak();
__debugbreak();
#endif
return;
}
handleCheckboxToggled(call->arguments[0].number, call->arguments[1].boolval);
return;
}
else if(wcscmp((wchar_t *)call->function_name.string,L"handleSliderMove")==0)
{
if(call->num_arguments != 2)
if(call->num_arguments == 2)
{
if (call->arguments[0].type == IGGY_DATATYPE_number && call->arguments[1].type == IGGY_DATATYPE_number)
return handleSliderMove(call->arguments[0].number, call->arguments[1].number);
}
else if(call->num_arguments == 3)
{
if (call->arguments[0].type == IGGY_DATATYPE_number && call->arguments[1].type == IGGY_DATATYPE_number)
return handleSliderMove(call->arguments[0].number, call->arguments[1].number);
}
else
{
app.DebugPrintf("Callback for handleSliderMove did not have the correct number of arguments\n");
#ifndef _CONTENT_PACKAGE
@@ -1278,15 +1295,12 @@ void UIScene::externalCallback(IggyExternalFunctionCallUTF16 * call)
#endif
return;
}
if(call->arguments[0].type != IGGY_DATATYPE_number || call->arguments[1].type != IGGY_DATATYPE_number)
{
app.DebugPrintf("Arguments for handleSliderMove were not of the correct type\n");
app.DebugPrintf("Arguments for handleSliderMove were not of the correct type\n");
#ifndef _CONTENT_PACKAGE
__debugbreak();
__debugbreak();
#endif
return;
}
handleSliderMove(call->arguments[0].number, call->arguments[1].number);
return;
}
else if(wcscmp((wchar_t *)call->function_name.string,L"handleAnimationEnd")==0)
{