Also print platform, game and OS version in assertion popup

This commit is contained in:
Robert Müller 2023-05-07 15:34:28 +02:00
parent cfd003d9c5
commit 3e810b9814

View file

@ -4590,8 +4590,11 @@ int main(int argc, const char **argv)
pClient->RegisterInterfaces();
dbg_assert_set_handler([pClient](const char *pMsg) {
char aMessage[256];
str_format(aMessage, sizeof(aMessage), "An assertion error occured. Please write down or take a screenshot of the following information and report this error.\n\n%s", pMsg);
char aVersionStr[128];
if(os_version_str(aVersionStr, sizeof(aVersionStr)))
str_copy(aVersionStr, "unknown");
char aMessage[512];
str_format(aMessage, sizeof(aMessage), "An assertion error occured. Please write down or take a screenshot of the following information and report this error.\nPlease also share the assert log which you should find in the 'dumps' folder in your config directory.\n\n%s\n\nPlatform: %s\nGame version: %s %s\nOS version: %s", pMsg, CONF_PLATFORM_STRING, GAME_RELEASE_VERSION, GIT_SHORTREV_HASH != nullptr ? GIT_SHORTREV_HASH : "", aVersionStr);
pClient->ShowMessageBox("Assertion Error", aMessage);
});