Prevent crash in anim_spline_poll

This commit is contained in:
MysterD 2022-02-27 01:05:36 -08:00
parent 0f86018bfe
commit c60f9f3e46
1 changed files with 3 additions and 0 deletions

View File

@ -889,6 +889,9 @@ s32 anim_spline_poll(struct MarioState* m, Vec3f result) {
vec3f_copy(result, gVec3fZero); vec3f_copy(result, gVec3fZero);
spline_get_weights(m, weights, m->splineKeyframeFraction, m->splineState); spline_get_weights(m, weights, m->splineKeyframeFraction, m->splineState);
if (m->splineKeyframe == NULL) { return FALSE; }
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
result[0] += weights[i] * m->splineKeyframe[i][1]; result[0] += weights[i] * m->splineKeyframe[i][1];
result[1] += weights[i] * m->splineKeyframe[i][2]; result[1] += weights[i] * m->splineKeyframe[i][2];