Fixed crash in geo_obj_init_animation*
This commit is contained in:
parent
d32bbacf21
commit
cc9dc2c38c
|
@ -756,6 +756,10 @@ void geo_obj_init_spawninfo(struct GraphNodeObject *graphNode, struct SpawnInfo
|
|||
* Initialize the animation of an object node
|
||||
*/
|
||||
void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr) {
|
||||
if (graphNode == NULL) { return; }
|
||||
if (animPtrAddr == NULL) { return; }
|
||||
if (*animPtrAddr == NULL) { return; }
|
||||
|
||||
struct Animation **animSegmented = segmented_to_virtual(animPtrAddr);
|
||||
struct Animation *anim = segmented_to_virtual(*animSegmented);
|
||||
|
||||
|
@ -771,6 +775,10 @@ void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation
|
|||
* Initialize the animation of an object node
|
||||
*/
|
||||
void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr, u32 animAccel) {
|
||||
if (graphNode == NULL) { return; }
|
||||
if (animPtrAddr == NULL) { return; }
|
||||
if (*animPtrAddr == NULL) { return; }
|
||||
|
||||
struct Animation **animSegmented = segmented_to_virtual(animPtrAddr);
|
||||
struct Animation *anim = segmented_to_virtual(*animSegmented);
|
||||
|
||||
|
|
|
@ -555,6 +555,10 @@ struct MarioState* nearest_mario_state_to_object(struct Object *obj) {
|
|||
checkActive = FALSE;
|
||||
} while (nearest == NULL);
|
||||
|
||||
if (nearest == NULL) {
|
||||
nearest = &gMarioStates[0];
|
||||
}
|
||||
|
||||
return nearest;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue