fix some crashes and bugs (#381)
- fix crash in bhv_lll_bowser_puzzle_piece_update (thanks to djoslin) - fix crash in platform_on_track_act_init - fix chat commands not working on dev builds - log when the crash handler is called - if a custom level tries to set an invalid background, change it to BACKGROUND_OCEAN_SKY
This commit is contained in:
parent
7e1e869114
commit
326dc43326
|
@ -112,6 +112,8 @@ bool exec_dev_chat_command(char* command) {
|
||||||
smlua_exec_file(&command[6]);
|
smlua_exec_file(&command[6]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dev_display_chat_commands(void) {
|
void dev_display_chat_commands(void) {
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
#include "game/rendering_graph_node.h"
|
#include "game/rendering_graph_node.h"
|
||||||
#include "game/area.h"
|
#include "game/area.h"
|
||||||
#include "geo_layout.h"
|
#include "geo_layout.h"
|
||||||
|
#include "include/geo_commands.h"
|
||||||
|
#include "pc/debuglog.h"
|
||||||
|
|
||||||
// unused Mtx(s)
|
// unused Mtx(s)
|
||||||
s16 identityMtx[4][4] = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } };
|
s16 identityMtx[4][4] = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } };
|
||||||
|
@ -486,6 +488,11 @@ struct GraphNodeBackground *init_graph_node_background(struct AllocOnlyPool *poo
|
||||||
if (graphNode != NULL) {
|
if (graphNode != NULL) {
|
||||||
init_scene_graph_node_links(&graphNode->fnNode.node, GRAPH_NODE_TYPE_BACKGROUND);
|
init_scene_graph_node_links(&graphNode->fnNode.node, GRAPH_NODE_TYPE_BACKGROUND);
|
||||||
|
|
||||||
|
if (background > BACKGROUND_CUSTOM) {
|
||||||
|
LOG_ERROR("invalid background id");
|
||||||
|
background = BACKGROUND_OCEAN_SKY;
|
||||||
|
}
|
||||||
|
|
||||||
graphNode->background = (background << 16) | background;
|
graphNode->background = (background << 16) | background;
|
||||||
graphNode->fnNode.func = backgroundFunc;
|
graphNode->fnNode.func = backgroundFunc;
|
||||||
graphNode->unused = zero; // always 0, unused
|
graphNode->unused = zero; // always 0, unused
|
||||||
|
|
|
@ -315,6 +315,8 @@ static void platform_on_track_rock_ski_lift(void) {
|
||||||
* Update function for bhvPlatformOnTrack.
|
* Update function for bhvPlatformOnTrack.
|
||||||
*/
|
*/
|
||||||
void bhv_platform_on_track_update(void) {
|
void bhv_platform_on_track_update(void) {
|
||||||
|
if (!o->oPlatformOnTrackStartWaypoint) { return; }
|
||||||
|
|
||||||
switch (o->oAction) {
|
switch (o->oAction) {
|
||||||
case PLATFORM_ON_TRACK_ACT_INIT:
|
case PLATFORM_ON_TRACK_ACT_INIT:
|
||||||
platform_on_track_act_init();
|
platform_on_track_act_init();
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "pc/network/network.h"
|
#include "pc/network/network.h"
|
||||||
#include "pc/gfx/gfx_rendering_api.h"
|
#include "pc/gfx/gfx_rendering_api.h"
|
||||||
#include "pc/mods/mods.h"
|
#include "pc/mods/mods.h"
|
||||||
|
#include "pc/debuglog.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
s32 x, y;
|
s32 x, y;
|
||||||
|
@ -298,6 +299,7 @@ static CRASH_HANDLER_TYPE crash_handler(EXCEPTION_POINTERS *ExceptionInfo) {
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
static void crash_handler(const int signalNum, siginfo_t *info, ucontext_t *context) {
|
static void crash_handler(const int signalNum, siginfo_t *info, ucontext_t *context) {
|
||||||
#endif
|
#endif
|
||||||
|
LOG_INFO("game crashed! preparing crash screen...");
|
||||||
memset(sCrashHandlerText, 0, sizeof(sCrashHandlerText));
|
memset(sCrashHandlerText, 0, sizeof(sCrashHandlerText));
|
||||||
CrashHandlerText *pText = &sCrashHandlerText[0];
|
CrashHandlerText *pText = &sCrashHandlerText[0];
|
||||||
gDjuiDisabled = true;
|
gDjuiDisabled = true;
|
||||||
|
|
Loading…
Reference in New Issue