diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonServerDelegate.kt b/common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonServerDelegate.kt index c01ccf1ab3..2e4b8fa5d5 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonServerDelegate.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/PokemonServerDelegate.kt @@ -26,6 +26,7 @@ import com.cobblemon.mod.common.api.spawning.fishing.FishingSpawnCause.Companion import com.cobblemon.mod.common.api.tags.CobblemonItemTags import com.cobblemon.mod.common.battles.BattleRegistry import com.cobblemon.mod.common.entity.PoseType +import com.cobblemon.mod.common.entity.pokemon.ai.PokemonMoveControl import com.cobblemon.mod.common.pokemon.Pokemon import com.cobblemon.mod.common.pokemon.activestate.ActivePokemonState import com.cobblemon.mod.common.pokemon.activestate.SentOutState @@ -244,11 +245,13 @@ class PokemonServerDelegate : PokemonSideDelegate { entity.entityData.set(PokemonEntity.ASPECTS, trackedAspects) entity.entityData.set(PokemonEntity.LABEL_LEVEL, entity.pokemon.level) + // Slow mons can travel less than the distance check each tick so steering somewhere counts too. + val travelling = entity.controllingPassenger == null && (entity.moveControl as? PokemonMoveControl)?.isTravelling == true if (entity.getCurrentPoseType() in PoseType.FLYING_POSES) { - entity.entityData.set(PokemonEntity.MOVING, entity.isPokemonFlying) + entity.entityData.set(PokemonEntity.MOVING, entity.isPokemonFlying || travelling) } else { - entity.entityData.set(PokemonEntity.MOVING, entity.isPokemonWalking) + entity.entityData.set(PokemonEntity.MOVING, entity.isPokemonWalking || travelling) } entity.entityData.set(PokemonEntity.FRIENDSHIP, entity.pokemon.friendship) diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/ai/PokemonMoveControl.kt b/common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/ai/PokemonMoveControl.kt index 6737b717cd..27ff646718 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/ai/PokemonMoveControl.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/entity/pokemon/ai/PokemonMoveControl.kt @@ -85,6 +85,9 @@ class PokemonMoveControl(val pokemonEntity: PokemonEntity) : MoveControl(pokemon private val speedEase = InertialEase(SPEED_BLEND_SECONDS) // What steering asked for this tick, null when it isn't steering private var steerGoal: SteerGoal? = null + /** True while steering somewhere this tick, however slowly. Used for the walk and fly poses */ + var isTravelling = false + private set private class SteerGoal( val yaw: Float, @@ -421,6 +424,7 @@ class PokemonMoveControl(val pokemonEntity: PokemonEntity) : MoveControl(pokemon */ private fun updateMotion() { val goal = steerGoal + isTravelling = goal != null && !pokemonEntity.isDeadOrDying val heading = pokemonEntity.heading val turnTarget = pokemonEntity.stationaryTurnTarget if (goal == null && turnTarget != null) {