mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-09-01 10:13:03 -04:00
Fix Camera nullptr (#599)
* Update spawn_players.c * Update spawn_players.c * Update code_80280000.c * Update Game.cpp * Add CM_ThrowRuntimeError function declaration * Update spawn_players.c * Modify CM_ThrowRuntimeError for improved error handling Increased the buffer size for error messages and added a crash description. * Update Game.cpp * Update Game.cpp * Update Game.h * Update Game.h * Update Game.h
This commit is contained in:
@@ -906,6 +906,29 @@ void push_frame() {
|
||||
// Graphics_ThreadUpdate();w
|
||||
}
|
||||
|
||||
void CM_ThrowRuntimeError(const char* fmt, ...) {
|
||||
char error_mesg[2048];
|
||||
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
vsnprintf(error_mesg, sizeof(error_mesg), fmt, args);
|
||||
va_end(args);
|
||||
|
||||
const char* crash_desc = "\nSpaghettiKart has crashed! Please upload the logs to the support channel in Discord.";
|
||||
strncat(error_mesg, crash_desc, sizeof(error_mesg) - strlen(error_mesg) - 1);
|
||||
|
||||
SPDLOG_ERROR(error_mesg);
|
||||
|
||||
SDL_ShowSimpleMessageBox(
|
||||
SDL_MESSAGEBOX_ERROR,
|
||||
"You dropped your plate of Spaghetti!",
|
||||
error_mesg,
|
||||
NULL
|
||||
);
|
||||
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
int SDL_main(int argc, char** argv) {
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user