Merge branch 'keyframe-super-ghostbusters' into 'main'

Fix for doubled effect keyframes

Closes #2107

See merge request cable-mc/cobblemon!2436
This commit is contained in:
Polymeta
2026-09-28 13:14:51 +00:00
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -84,6 +84,7 @@
- Fixed Kingambit moving its legs while walking
- Various Structure fixes
- Fixed shiny pokemon under certain circumstances forgetting taught TMs
- Fixed certain Pokémon sounds sometimes being doubled when played at specific times in their animations
### Developer
- Fixed wrong order of operations in the code flow prior to the `FOSSIL_REVIVED` event causing pokemon to appear without entity link
@@ -262,9 +262,9 @@ data class BedrockAnimation(
fun applyEffects(entity: Entity?, state: PosableState, previousSeconds: Float, newSeconds: Float) {
val effectCondition: (effectKeyframe: BedrockEffectKeyframe) -> Boolean =
if (previousSeconds > newSeconds) {
{ it.seconds >= previousSeconds || it.seconds <= newSeconds }
{ it.seconds >= previousSeconds || it.seconds < newSeconds }
} else {
{ it.seconds in previousSeconds..newSeconds }
{ it.seconds >= previousSeconds && it.seconds < newSeconds }
}
effects.filter(effectCondition).forEach { it.run(entity, state) }