mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 21:45:12 +00:00
Hopefully fix passes_pvp_interaction_checks crash (#343)
* Hopefully fix passes_pvp_interaction_checks crash * Hopefully fix cur_obj_call_action_function crash
This commit is contained in:
parent
3b0e650dda
commit
aba6483e5e
4 changed files with 7 additions and 4 deletions
|
@ -161,9 +161,7 @@ u32 get_mario_spawn_type(struct Object *o) {
|
|||
}
|
||||
|
||||
struct ObjectWarpNode *area_get_warp_node(u8 id) {
|
||||
if (gCurrentArea == NULL || gCurrentArea->warpNodes == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
if (!gCurrentArea || !gCurrentArea->warpNodes) { return NULL; }
|
||||
|
||||
struct ObjectWarpNode *node = NULL;
|
||||
|
||||
|
|
|
@ -1353,6 +1353,8 @@ u8 player_is_sliding(struct MarioState* m) {
|
|||
}
|
||||
|
||||
u8 passes_pvp_interaction_checks(struct MarioState* attacker, struct MarioState* victim) {
|
||||
if (!attacker || !victim) { return false; }
|
||||
|
||||
// attacked
|
||||
u8 isInCutscene = ((attacker->action & ACT_GROUP_MASK) == ACT_GROUP_CUTSCENE) || ((victim->action & ACT_GROUP_MASK) == ACT_GROUP_CUTSCENE);
|
||||
isInCutscene = isInCutscene || (attacker->action == ACT_IN_CANNON) || (victim->action == ACT_IN_CANNON);
|
||||
|
|
|
@ -2664,7 +2664,10 @@ s32 cur_obj_move_up_and_down(s32 a0) {
|
|||
}
|
||||
|
||||
void cur_obj_call_action_function(void (*actionFunctions[])(void)) {
|
||||
if (!actionFunctions) { return; }
|
||||
|
||||
void (*actionFunction)(void) = actionFunctions[o->oAction];
|
||||
if (!actionFunction) { return; }
|
||||
actionFunction();
|
||||
}
|
||||
|
||||
|
|
|
@ -332,7 +332,7 @@ static void open_mod_file(struct Mod* mod, struct ModFile* file) {
|
|||
}
|
||||
|
||||
void network_receive_download(struct Packet* p) {
|
||||
if (p == NULL) {
|
||||
if (!p) {
|
||||
LOG_ERROR("Received null packet");
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue