mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-28 23:13:02 +00:00
Fixed crash in geo_obj_init_animation*
This commit is contained in:
parent
334de77139
commit
4568da45f3
2 changed files with 12 additions and 0 deletions
|
@ -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 a new issue