Compare commits

...
Author SHA1 Message Date
Neovitalism 743497dbca Update SwitchInstruction.kt
Prevents pokémon from showing up after the battle has ended.
2026-01-15 22:23:06 -06:00
@@ -184,14 +184,16 @@ class SwitchInstruction(val instructionSet: InstructionSet, val battleActor: Bat
else activePokemon.position?.second) ?: entity.position()
// Send out at previous Pokémon's location if it is known, otherwise actor location
val world = entity.level() as ServerLevel
newPokemon.effectedPokemon.sendOutWithAnimation(
source = entity,
battleId = battle.battleId,
level = world,
position = pos,
doCry = !imposter,
illusion = illusion?.let { IllusionEffect(it.effectedPokemon) }
).thenAccept { sendOutFuture.complete(Unit) }
if (!battle.ended) {
newPokemon.effectedPokemon.sendOutWithAnimation(
source = entity,
battleId = battle.battleId,
level = world,
position = pos,
doCry = !imposter,
illusion = illusion?.let { IllusionEffect(it.effectedPokemon) }
).thenAccept { sendOutFuture.complete(Unit) }
} else sendOutFuture.complete(Unit)
}
broadcastSwitch(battle, actor, newPokemon, illusion)