Fixed unfusion of traded materials (#6415)
Co-authored-by: Hedara <hedara90@gmail.com>
This commit is contained in:
parent
3ca4ce2444
commit
7af9984a4d
@ -6182,6 +6182,27 @@ bool32 TryItemUseFusionChange(u8 taskId, TaskFunc task)
|
||||
}
|
||||
}
|
||||
|
||||
static void RestoreFusionMon(struct Pokemon *mon)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES, NULL) == SPECIES_NONE)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i >= PARTY_SIZE)
|
||||
{
|
||||
CopyMonToPC(mon);
|
||||
}
|
||||
else
|
||||
{
|
||||
CopyMon(&gPlayerParty[i], mon, sizeof(*mon));
|
||||
gPlayerPartyCount = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void Task_TryItemUseFusionChange(u8 taskId)
|
||||
{
|
||||
struct Pokemon *mon = &gPlayerParty[gTasks[taskId].firstFusionSlot];
|
||||
@ -6202,7 +6223,7 @@ static void Task_TryItemUseFusionChange(u8 taskId)
|
||||
else
|
||||
{
|
||||
mon2 = &gPokemonStoragePtr->fusions[gTasks[taskId].storageIndex];
|
||||
GiveMonToPlayer(mon2);
|
||||
RestoreFusionMon(mon2);
|
||||
ZeroMonData(&gPokemonStoragePtr->fusions[gTasks[taskId].storageIndex]);
|
||||
}
|
||||
targetSpecies = gTasks[taskId].tTargetSpecies;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user