Recovery Heart (#360)
changes nearest_mario_state_to_object to nearest_interacting_mario_state_to_object
This commit is contained in:
parent
fe934ffe82
commit
0efd9ef21a
|
@ -27,7 +27,7 @@ void bhv_recovery_heart_loop(void) {
|
||||||
o->oSpinningHeartPlayedSound += 1;
|
o->oSpinningHeartPlayedSound += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct MarioState* marioState = nearest_mario_state_to_object(o);
|
struct MarioState* marioState = nearest_interacting_mario_state_to_object(o);
|
||||||
if (marioState) {
|
if (marioState) {
|
||||||
o->oAngleVelYaw = (s32)(200.0f * marioState->forwardVel) + 1000;
|
o->oAngleVelYaw = (s32)(200.0f * marioState->forwardVel) + 1000;
|
||||||
}
|
}
|
||||||
|
@ -42,11 +42,11 @@ void bhv_recovery_heart_loop(void) {
|
||||||
|
|
||||||
if ((o->oSpinningHeartTotalSpin += o->oAngleVelYaw) >= 0x10000) {
|
if ((o->oSpinningHeartTotalSpin += o->oAngleVelYaw) >= 0x10000) {
|
||||||
|
|
||||||
struct MarioState* nearestState = nearest_mario_state_to_object(o);
|
struct MarioState* nearestInteractingState = nearest_interacting_mario_state_to_object(o);
|
||||||
for (s32 i = 0; i < MAX_PLAYERS; i++) {
|
for (s32 i = 0; i < MAX_PLAYERS; i++) {
|
||||||
if (!gMarioStates[i].visibleToEnemies) { continue; }
|
if (!gMarioStates[i].visibleToEnemies) { continue; }
|
||||||
if (!is_player_active(&gMarioStates[i])) { continue; }
|
if (!is_player_active(&gMarioStates[i])) { continue; }
|
||||||
if (&gMarioStates[i] == nearestState || dist_between_objects(o, gMarioStates[i].marioObj) < 1000) {
|
if (&gMarioStates[i] == nearestInteractingState || dist_between_objects(o, gMarioStates[i].marioObj) < 1000) {
|
||||||
gMarioStates[i].healCounter += 4;
|
gMarioStates[i].healCounter += 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue