Koopa shell can only be ridden by one person, and doesn't get accidentally removed

This commit is contained in:
MysterD 2020-10-06 23:38:56 -07:00
parent d2e1b6e5a0
commit ea1553c18d
3 changed files with 9 additions and 5 deletions

View file

@ -293,7 +293,7 @@ u32 attack_object(struct Object *o, s32 interaction) {
}
void mario_stop_riding_object(struct MarioState *m) {
if (m->riddenObj != NULL) {
if (m->riddenObj != NULL && m->playerIndex == 0) {
m->riddenObj->oInteractStatus = INT_STATUS_STOP_RIDING;
if (m->playerIndex == 0) { stop_shell_music(); }
m->riddenObj = NULL;
@ -1699,6 +1699,10 @@ u32 interact_breakable(struct MarioState *m, UNUSED u32 interactType, struct Obj
}
u32 interact_koopa_shell(struct MarioState *m, UNUSED u32 interactType, struct Object *o) {
if (o->oInteractStatus & INT_STATUS_INTERACTED) {
return FALSE;
}
if (!(m->action & ACT_FLAG_RIDING_SHELL)) {
u32 interaction = determine_interaction(m, o);

View file

@ -1070,7 +1070,7 @@ s32 act_crazy_box_bounce(struct MarioState *m) {
if (m->actionArg < 2) {
set_mario_action(m, ACT_CRAZY_BOX_BOUNCE, m->actionArg + 1);
} else {
if (m->heldObj != NULL) {
if (m->heldObj != NULL && m->playerIndex == 0) {
m->heldObj->oInteractStatus = INT_STATUS_STOP_RIDING;
m->heldObj = NULL;
}

View file

@ -750,7 +750,7 @@ static s32 act_water_shell_swimming(struct MarioState *m) {
}
if (m->actionTimer++ == 240) {
if (m->heldObj != NULL) {
if (m->heldObj != NULL && m->playerIndex == 0) {
m->heldObj->oInteractStatus = INT_STATUS_STOP_RIDING;
m->heldObj = NULL;
}
@ -1503,10 +1503,10 @@ static s32 check_common_submerged_cancels(struct MarioState *m) {
// where your held object is the shell, but you are not in the
// water shell swimming action. This allows you to hold the water
// shell on land (used for cloning in DDD).
if (m->action == ACT_WATER_SHELL_SWIMMING && m->heldObj != NULL) {
if (m->action == ACT_WATER_SHELL_SWIMMING && m->heldObj != NULL && m->playerIndex == 0) {
m->heldObj->oInteractStatus = INT_STATUS_STOP_RIDING;
m->heldObj = NULL;
if (m->playerIndex == 0) { stop_shell_music(); }
stop_shell_music();
}
return transition_submerged_to_walking(m);