Apply suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
Wlowscha 2025-05-27 13:09:48 +02:00 committed by GitHub
parent 0a7ecb94ff
commit e0f75cb38d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -549,7 +549,8 @@ export default class PartyUiHandler extends MessageUiHandler {
for (let p = 0; p < globalScene.getPlayerParty().length; p++) { for (let p = 0; p < globalScene.getPlayerParty().length; p++) {
// this for look goes through each of the party pokemon // this for look goes through each of the party pokemon
const newPokemon = globalScene.getPlayerParty()[p]; const newPokemon = globalScene.getPlayerParty()[p];
// this next bit checks to see if the the selected item from the original transfer pokemon exists on the new pokemon [p]; this returns undefined if the new pokemon doesn't have the item at all, otherwise it returns the pokemonHeldItemModifier for that item // this next bit checks to see if the the selected item from the original transfer pokemon exists on the new pokemon `p`
// this returns `undefined` if the new pokemon doesn't have the item at all, otherwise it returns the `pokemonHeldItemModifier` for that item
const matchingModifier = globalScene.findModifier( const matchingModifier = globalScene.findModifier(
m => m =>
m instanceof PokemonHeldItemModifier && m instanceof PokemonHeldItemModifier &&
@ -1165,7 +1166,7 @@ export default class PartyUiHandler extends MessageUiHandler {
globalScene.findModifier( globalScene.findModifier(
m => m =>
m instanceof SwitchEffectTransferModifier && m instanceof SwitchEffectTransferModifier &&
(m as SwitchEffectTransferModifier).pokemonId === globalScene.getPlayerField()[this.fieldIndex].id, m.pokemonId === globalScene.getPlayerField()[this.fieldIndex].id,
) )
); );
} }