diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 97b0a061bb..597d0b7c5f 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -744,7 +744,7 @@ static void OpponentHandleEndLinkBattle(u32 battler) { if (gBattleTypeFlags & BATTLE_TYPE_LINK && !(gBattleTypeFlags & BATTLE_TYPE_IS_MASTER)) { - gMain.inBattle = 0; + gMain.inBattle = FALSE; gMain.callback1 = gPreBattleCallback1; SetMainCallback2(gMain.savedCallback); } diff --git a/src/event_object_movement.c b/src/event_object_movement.c index f019c3aad8..10d427e517 100644 --- a/src/event_object_movement.c +++ b/src/event_object_movement.c @@ -8077,14 +8077,18 @@ static void DoGroundEffects_OnSpawn(struct ObjectEvent *objEvent, struct Sprite { u32 flags; +#ifdef BUGFIX + if (objEvent->triggerGroundEffectsOnMove && objEvent->localId != OBJ_EVENT_ID_CAMERA) +#else if (objEvent->triggerGroundEffectsOnMove) +#endif { flags = 0; UpdateObjectEventElevationAndPriority(objEvent, sprite); GetAllGroundEffectFlags_OnSpawn(objEvent, &flags); SetObjectEventSpriteOamTableForLongGrass(objEvent, sprite); DoFlaggedGroundEffects(objEvent, sprite, flags); - objEvent->triggerGroundEffectsOnMove = 0; + objEvent->triggerGroundEffectsOnMove = FALSE; objEvent->disableCoveringGroundEffects = 0; } } @@ -8093,7 +8097,11 @@ static void DoGroundEffects_OnBeginStep(struct ObjectEvent *objEvent, struct Spr { u32 flags; +#ifdef BUGFIX + if (objEvent->triggerGroundEffectsOnMove && objEvent->localId != OBJ_EVENT_ID_CAMERA) +#else if (objEvent->triggerGroundEffectsOnMove) +#endif { flags = 0; UpdateObjectEventElevationAndPriority(objEvent, sprite); @@ -8101,7 +8109,7 @@ static void DoGroundEffects_OnBeginStep(struct ObjectEvent *objEvent, struct Spr SetObjectEventSpriteOamTableForLongGrass(objEvent, sprite); filters_out_some_ground_effects(objEvent, &flags); DoFlaggedGroundEffects(objEvent, sprite, flags); - objEvent->triggerGroundEffectsOnMove = 0; + objEvent->triggerGroundEffectsOnMove = FALSE; objEvent->disableCoveringGroundEffects = 0; } } @@ -8110,7 +8118,11 @@ static void DoGroundEffects_OnFinishStep(struct ObjectEvent *objEvent, struct Sp { u32 flags; +#ifdef BUGFIX + if (objEvent->triggerGroundEffectsOnStop && objEvent->localId != OBJ_EVENT_ID_CAMERA) +#else if (objEvent->triggerGroundEffectsOnStop) +#endif { flags = 0; UpdateObjectEventElevationAndPriority(objEvent, sprite); diff --git a/src/field_effect.c b/src/field_effect.c index c111f3113d..dcfbd57078 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -2500,7 +2500,7 @@ static void TeleportWarpInFieldEffect_SpinEnter(struct Task *task) if (task->data[13] == 0) { task->data[13]++; - objectEvent->triggerGroundEffectsOnMove = 1; + objectEvent->triggerGroundEffectsOnMove = TRUE; sprite->subspriteMode = task->data[14]; } } else diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 89b47341fb..50438863af 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1665,6 +1665,10 @@ static void Task_WaitStopSurfing(u8 taskId) gPlayerAvatar.preventStep = FALSE; UnlockPlayerFieldControls(); DestroySprite(&gSprites[playerObjEvent->fieldEffectSpriteId]); +#ifdef BUGFIX + // If this is not defined but the player steps into grass from surfing, they will appear over the grass instead of in the grass. + playerObjEvent->triggerGroundEffectsOnMove = TRUE; +#endif DestroyTask(taskId); } } diff --git a/src/overworld.c b/src/overworld.c index e53e556302..db4b499655 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -3088,7 +3088,7 @@ static void SetPlayerFacingDirection(u8 linkPlayerId, u8 facing) { if (facing > FACING_FORCED_RIGHT) { - objEvent->triggerGroundEffectsOnMove = 1; + objEvent->triggerGroundEffectsOnMove = TRUE; } else { @@ -3237,7 +3237,7 @@ static void CreateLinkPlayerSprite(u8 linkPlayerId, u8 gameVersion) sprite = &gSprites[objEvent->spriteId]; sprite->coordOffsetEnabled = TRUE; sprite->data[0] = linkPlayerId; - objEvent->triggerGroundEffectsOnMove = 0; + objEvent->triggerGroundEffectsOnMove = FALSE; } } diff --git a/src/trainer_see.c b/src/trainer_see.c index ee10747cdf..7a88d3cf46 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -623,7 +623,7 @@ static bool8 JumpInPlaceBuriedTrainer(u8 taskId, struct Task *task, struct Objec if (gSprites[task->tOutOfAshSpriteId].animCmdIndex == 2) { trainerObj->fixedPriority = 0; - trainerObj->triggerGroundEffectsOnMove = 1; + trainerObj->triggerGroundEffectsOnMove = TRUE; sprite = &gSprites[trainerObj->spriteId]; sprite->oam.priority = 2;