mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-25 05:25:14 +00:00
Fix Ukiki and Koopa the Quick crashing the game (#481)
* Fix KTQ Crash * Fix Ukiki Crash * Just mark ukiki for deletion instead * Add a return;
This commit is contained in:
parent
a62f7a63f9
commit
40fe8ef649
2 changed files with 14 additions and 3 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
/**
|
||||
* Behavior for bhvKoopa and bhvKoopaRaceEndpoint.
|
||||
* bhvKoopa includes normal, unshelled, tiny, and Koopa the Quick.
|
||||
|
@ -116,7 +115,13 @@ void bhv_koopa_init(void) {
|
|||
|
||||
if (o->oKoopaMovementType >= KOOPA_BP_KOOPA_THE_QUICK_BASE) {
|
||||
// koopa the quick
|
||||
o->parentObj = cur_obj_nearest_object_with_behavior(bhvKoopaRaceEndpoint);
|
||||
if (cur_obj_nearest_object_with_behavior(bhvKoopaRaceEndpoint) != NULL) {
|
||||
o->parentObj = cur_obj_nearest_object_with_behavior(bhvKoopaRaceEndpoint);
|
||||
}
|
||||
else {
|
||||
obj_mark_for_deletion(o);
|
||||
return;
|
||||
}
|
||||
struct SyncObject* so = sync_object_init(o, SYNC_DISTANCE_ONLY_EVENTS);
|
||||
if (so) {
|
||||
so->on_received_post = bhv_koopa_the_quick_on_received_post;
|
||||
|
|
|
@ -365,7 +365,13 @@ void ukiki_act_go_to_cage(void) {
|
|||
struct Object* obj;
|
||||
f32 latDistToCage = 0.0f;
|
||||
s16 yawToCage = 0;
|
||||
obj = cur_obj_nearest_object_with_behavior(bhvUkikiCageChild);
|
||||
if (cur_obj_nearest_object_with_behavior(bhvUkikiCageChild) != NULL) {
|
||||
obj = cur_obj_nearest_object_with_behavior(bhvUkikiCageChild);
|
||||
}
|
||||
else {
|
||||
obj_mark_for_deletion(o);
|
||||
return;
|
||||
}
|
||||
|
||||
// Ultimately is checking the cage, as it points to the parent
|
||||
// of a dummy child object of the cage.
|
||||
|
|
Loading…
Reference in a new issue