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