Add check for nullptr in this func as well

This commit is contained in:
FutureRave 2022-02-22 17:16:12 +00:00
parent 74579be0b1
commit 4ed09b1828
No known key found for this signature in database
GPG Key ID: E883E2BC9657D955

View File

@ -747,9 +747,16 @@ namespace Components
Script::LastFrameTime = nowMs;
});
Script::AddFunction("debugBox", [](Game::scr_entref_t)
Script::AddFunction("DebugBox", [](Game::scr_entref_t)
{
MessageBoxA(nullptr, Game::Scr_GetString(0), "DEBUG", 0);
const auto* message = Game::Scr_GetString(0);
if (message == nullptr)
{
Game::Scr_Error("^1DebugBox: Illegal parameter!\n");
}
MessageBoxA(nullptr, message, "DEBUG", MB_OK);
}, true);
Script::AddFunctions();