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:
MegaMech
2025-12-18 19:03:43 -07:00
committed by GitHub
parent 509a8f4259
commit 7d64601d85
4 changed files with 85 additions and 28 deletions
+23
View File
@@ -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