Match SortKinstoneBag

extract kinstone related data from SaveFile into it's own struct

Co-authored-by: KEKW555 <152369890+KEKW555@users.noreply.github.com>
This commit is contained in:
Henny022p 2023-12-24 04:54:59 +01:00
parent 040b1f3a59
commit 1944bf5e6d
14 changed files with 76 additions and 111 deletions

View File

@ -28,6 +28,24 @@ typedef enum {
*/ */
extern SaveResult HandleSave(u32 idx); extern SaveResult HandleSave(u32 idx);
/**
* Contains save data regarding kinstones
*/
typedef struct {
u8 unused[2]; /**< unused */
u8 didAllFusions; /**< completed all 100 kinstone fusions */
u8 fusedCount; /**< number of kinstones fused */
u8 types[19]; /**< item id for each kinstone type present in kinstone bag */
u8 amounts[19]; /**< amount of each kinstone type above */
u8 filler[3]; /**< unused filler */
u8 fuserProgress[128]; /**< indexed by fuser id, incremented after fusion */
u8 fuserOffers[128]; /**< available kinstone fusion for each fuser */
u8 fusedKinstones[13]; /**< bitfield for fused kinstones
* @see CheckKinstoneFused */
u8 fusionUnmarked[13]; /**< bitfield for disabled fusion map markers
* @see CheckFusionMapMarkerDisabled */
} KinstoneSave;
/** /**
* Contains all information about a save file. * Contains all information about a save file.
* The contents of this structure are read from and written to EEPROM. * The contents of this structure are read from and written to EEPROM.
@ -58,19 +76,8 @@ typedef struct {
/*0x0A8*/ Stats stats; /**< Player stats. */ /*0x0A8*/ Stats stats; /**< Player stats. */
/*0x0CC*/ u8 fillerCC[2]; /**< unused filler */ /*0x0CC*/ u8 fillerCC[2]; /**< unused filler */
/*0x0D0*/ u8 figurines[36]; /**< figurine bitset */ /*0x0D0*/ u8 figurines[36]; /**< figurine bitset */
/*0x0F2*/ u8 inventory[36]; /**< 2 bit per item @see Item */ /*0x0F2*/ u8 inventory[34]; /**< 2 bit per item @see Item */
/*0x116*/ u8 didAllFusions; /**< completed all 100 kinstone fusions */ /*0x114*/ KinstoneSave kinstones; /**< save data for kinstones @see KinstoneSave */
/*0x117*/ u8 fusedKinstoneCount; /**< number of kinstones fused */
/*0x118*/ u8 kinstoneTypes[19]; /**< item id for each kinstone type present in kinstone bag */
/*0x12B*/ u8 kinstoneAmounts[19]; /**< amount of each kinstone type above */
/*0x13E*/ u8 filler13E[3]; /**< unused filler */
/*0x141*/ u8 fuserProgress[128]; /**< indexed by fuser id, incremented after fusion */
/*0x1C1*/ u8 fuserOffers[128]; /**< available kinstone fusion for each fuser */
/*0x241*/ u8 fusedKinstones[13]; /**< bitfield for fused kinstones
* @see CheckKinstoneFused */
/*0x24E*/ u8 fusionUnmarked[13]; /**< bitfield for disabled fusion map markers
* @see CheckFusionMapMarkerDisabled */
/*0x25B*/ u8 filler25B; /**< unused filler */
/*0x25C*/ u8 flags[0x200]; /**< flags */ /*0x25C*/ u8 flags[0x200]; /**< flags */
/*0x45C*/ u8 dungeonKeys[0x10]; /**< indexed by dungeon id, keys per dungeon */ /*0x45C*/ u8 dungeonKeys[0x10]; /**< indexed by dungeon id, keys per dungeon */
/*0x46C*/ u8 dungeonItems[0x10]; /**< dungeon items 4: compass, 2: big key, 1: small key */ /*0x46C*/ u8 dungeonItems[0x10]; /**< dungeon items 4: compass, 2: big key, 1: small key */

View File

@ -1054,13 +1054,13 @@ void NotifyFusersOnFusionDone(KinstoneId kinstoneId) {
u32 index; u32 index;
if (kinstoneId - 1 < 100) { if (kinstoneId - 1 < 100) {
for (index = 0; index < 0x80; index++) { for (index = 0; index < 0x80; index++) {
if (kinstoneId == gSave.fuserOffers[index]) { if (kinstoneId == gSave.kinstones.fuserOffers[index]) {
gSave.fuserOffers[index] = KINSTONE_NEEDS_REPLACEMENT; gSave.kinstones.fuserOffers[index] = KINSTONE_NEEDS_REPLACEMENT;
} }
} }
tmp = GetFuserId(gFuseInfo.entity); tmp = GetFuserId(gFuseInfo.entity);
if ((tmp - 1 < 0x7f) && (gSave.fuserOffers[tmp] == KINSTONE_NEEDS_REPLACEMENT)) { if ((tmp - 1 < 0x7f) && (gSave.kinstones.fuserOffers[tmp] == KINSTONE_NEEDS_REPLACEMENT)) {
gSave.fuserOffers[tmp] = KINSTONE_JUST_FUSED; gSave.kinstones.fuserOffers[tmp] = KINSTONE_JUST_FUSED;
} }
for (index = 0; index < 0x20; index++) { for (index = 0; index < 0x20; index++) {
if (kinstoneId == gPossibleInteraction.candidates[index].kinstoneId) { if (kinstoneId == gPossibleInteraction.candidates[index].kinstoneId) {
@ -1079,17 +1079,17 @@ void AddKinstoneToBag(KinstoneId kinstoneId) {
index = GetIndexInKinstoneBag(kinstoneId); index = GetIndexInKinstoneBag(kinstoneId);
if (index < 0) { if (index < 0) {
index = 0; index = 0;
while (gSave.kinstoneTypes[index] != KINSTONE_NONE) { while (gSave.kinstones.types[index] != KINSTONE_NONE) {
index++; index++;
} }
} }
if ((u32)index < 0x12) { if ((u32)index < 0x12) {
gSave.kinstoneTypes[index] = kinstoneId; gSave.kinstones.types[index] = kinstoneId;
tmp = gSave.kinstoneAmounts[index] + 1; tmp = gSave.kinstones.amounts[index] + 1;
if (tmp > 99) { if (tmp > 99) {
tmp = 99; tmp = 99;
} }
gSave.kinstoneAmounts[index] = tmp; gSave.kinstones.amounts[index] = tmp;
} }
} }
} }
@ -1097,12 +1097,12 @@ void AddKinstoneToBag(KinstoneId kinstoneId) {
void RemoveKinstoneFromBag(KinstoneId kinstoneId) { void RemoveKinstoneFromBag(KinstoneId kinstoneId) {
s32 idx = GetIndexInKinstoneBag(kinstoneId); s32 idx = GetIndexInKinstoneBag(kinstoneId);
if (idx >= 0) { if (idx >= 0) {
s32 next = gSave.kinstoneAmounts[idx] - 1; s32 next = gSave.kinstones.amounts[idx] - 1;
if (next <= 0) { if (next <= 0) {
gSave.kinstoneTypes[idx] = KINSTONE_NONE; gSave.kinstones.types[idx] = KINSTONE_NONE;
next = 0; next = 0;
} }
gSave.kinstoneAmounts[idx] = next; gSave.kinstones.amounts[idx] = next;
} }
} }
@ -1111,92 +1111,50 @@ u32 GetAmountInKinstoneBag(KinstoneId kinstoneId) {
if (index < 0) { if (index < 0) {
return 0; return 0;
} }
return gSave.kinstoneAmounts[index]; return gSave.kinstones.amounts[index];
} }
u32 CheckKinstoneFused(KinstoneId kinstoneId) { u32 CheckKinstoneFused(KinstoneId kinstoneId) {
if (kinstoneId - 1 >= 100) { if (kinstoneId - 1 >= 100) {
return 0; return 0;
} }
return ReadBit(&gSave.fusedKinstones, kinstoneId); return ReadBit(&gSave.kinstones.fusedKinstones, kinstoneId);
} }
bool32 CheckFusionMapMarkerDisabled(KinstoneId kinstoneId) { bool32 CheckFusionMapMarkerDisabled(KinstoneId kinstoneId) {
if (kinstoneId - 1 >= 100) { if (kinstoneId - 1 >= 100) {
return FALSE; return FALSE;
} }
return ReadBit(&gSave.fusionUnmarked, kinstoneId); return ReadBit(&gSave.kinstones.fusionUnmarked, kinstoneId);
} }
void SortKinstoneBag(void) { void SortKinstoneBag(void) {
#ifdef NON_MATCHING u32 i;
u32 r5;
for (r5 = 0; r5 < 0x13; r5++) { KinstoneSave* ptr = &gSave.kinstones;
if (gSave.kinstoneAmounts[r5] == 0) {
gSave.kinstoneTypes[r5] = gSave.kinstoneAmounts[r5]; for (i = 0; i < 19; i++) {
if (ptr->amounts[i] == 0) {
ptr->types[i] = 0;
} }
} }
gSave.kinstoneTypes[0x12] = 0; ptr->types[18] = 0;
gSave.kinstoneAmounts[0x12] = 0; ptr->amounts[18] = 0;
for (r5 = 0; r5 < 0x12; r5++) { for (i = 0; i < 18; i++) {
if ((gSave.kinstoneTypes[r5] - 0x65) > 0x10) { u32 t = ptr->types[i];
MemCopy(&gSave.kinstoneTypes[r5 + 1], &gSave.kinstoneTypes[r5], 0x12 - r5); if (t < 0x65 || t > 0x75) {
MemCopy(&gSave.kinstoneAmounts[r5 + 1], &gSave.kinstoneAmounts[r5], 0x12 - r5); MemCopy(&ptr->types[i + 1], &ptr->types[i], 0x12 - i);
MemCopy(&ptr->amounts[i + 1], &ptr->amounts[i], 0x12 - i);
} }
} }
#else
u32 r0, r4, r5;
u32 new_var;
u8 *r1, *r2, *r3, *r6, *r7, *r8, *r9, *r10;
new_var = 4;
r1 = &gSave.inventory[34];
r5 = 0;
r2 = gSave.kinstoneTypes;
code0_0:
r0 = r2[0x13];
r3 = &r1[4];
r10 = r3;
if (r0 == 0) {
*r2 = r0;
}
r2++;
r5++;
if (r5 <= 0x12)
goto code0_0;
r1[0x16] = 0;
r1[0x29] = 0;
r5 = 0;
r9 = &r1[0x17];
r3 = &r1[0x18];
r8 = r3;
r7 = &r1[new_var];
r6 = &r1[5];
code0_2:
r0 = r10[r5] - 0x65;
if (r0 > 0x10) {
MemCopy(r6, r7, 0x12 - r5);
MemCopy(r8, r9, 0x12 - r5);
}
r9++;
r8++;
r7++;
r6++;
r5++;
if (r5 <= 0x11)
goto code0_2;
#endif
} }
s32 GetIndexInKinstoneBag(KinstoneId kinstoneId) { s32 GetIndexInKinstoneBag(KinstoneId kinstoneId) {
u32 i; u32 i;
for (i = 0; i < 0x12; ++i) { for (i = 0; i < 0x12; ++i) {
if (kinstoneId == gSave.kinstoneTypes[i]) if (kinstoneId == gSave.kinstones.types[i])
return i; return i;
} }
return -1; return -1;
@ -1264,7 +1222,7 @@ void UpdateVisibleFusionMapMarkers(void) {
#else #else
if (sub_0807CB24(tmp, s->flag)) { if (sub_0807CB24(tmp, s->flag)) {
#endif #endif
WriteBit(&gSave.fusionUnmarked, kinstoneId); WriteBit(&gSave.kinstones.fusionUnmarked, kinstoneId);
} }
} }
} }
@ -1285,8 +1243,8 @@ KinstoneId GetFusionToOffer(Entity* entity) {
if (GetInventoryValue(ITEM_KINSTONE_BAG) == 0 || fuserData[0] > gSave.global_progress) { if (GetInventoryValue(ITEM_KINSTONE_BAG) == 0 || fuserData[0] > gSave.global_progress) {
return KINSTONE_NONE; return KINSTONE_NONE;
} }
offeredFusion = gSave.fuserOffers[fuserId]; offeredFusion = gSave.kinstones.fuserOffers[fuserId];
fuserProgress = gSave.fuserProgress[fuserId]; fuserProgress = gSave.kinstones.fuserProgress[fuserId];
fuserFusionData = (u8*)(fuserProgress + (u32)fuserData); fuserFusionData = (u8*)(fuserProgress + (u32)fuserData);
while (TRUE) { // loop through fusions for this fuser while (TRUE) { // loop through fusions for this fuser
switch (offeredFusion) { switch (offeredFusion) {
@ -1317,8 +1275,8 @@ KinstoneId GetFusionToOffer(Entity* entity) {
} }
offeredFusion = KINSTONE_NEEDS_REPLACEMENT; // already completed, try next fusion in the list offeredFusion = KINSTONE_NEEDS_REPLACEMENT; // already completed, try next fusion in the list
} }
gSave.fuserOffers[fuserId] = offeredFusion; gSave.kinstones.fuserOffers[fuserId] = offeredFusion;
gSave.fuserProgress[fuserId] = fuserProgress; gSave.kinstones.fuserProgress[fuserId] = fuserProgress;
randomMood = Random(); randomMood = Random();
fuserStability = fuserData[1]; fuserStability = fuserData[1];
if (fuserStability <= randomMood % 100) { if (fuserStability <= randomMood % 100) {

View File

@ -480,7 +480,7 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
ptr2 = &gDroptableModifiers[DROPTABLE_NO_SHELLS]; ptr2 = &gDroptableModifiers[DROPTABLE_NO_SHELLS];
} }
// don't drop kinstones anymore // don't drop kinstones anymore
if (gSave.didAllFusions != 0) { if (gSave.kinstones.didAllFusions != 0) {
ptr3 = &gDroptableModifiers[DROPTABLE_NO_KINSTONES]; ptr3 = &gDroptableModifiers[DROPTABLE_NO_KINSTONES];
} }
// vector addition, s0 = s0 + ptr2 + ptr3 // vector addition, s0 = s0 + ptr2 + ptr3

View File

@ -86,7 +86,7 @@ const ScreenTransitionData gUnk_08128024[] = {
u32 sub_080A3B48(void) { u32 sub_080A3B48(void) {
u32 index; u32 index;
for (index = 0; index <= 0x12; index++) { for (index = 0; index <= 0x12; index++) {
if (gSave.kinstoneAmounts[index] == 0) { if (gSave.kinstones.amounts[index] == 0) {
break; break;
} }
} }
@ -206,7 +206,7 @@ void KinstoneMenu_Type1(void) {
case A_BUTTON: case A_BUTTON:
if (gMenu.column_idx == 2) { if (gMenu.column_idx == 2) {
tmp3 = gGenericMenu.unk10.i / 0x10000; tmp3 = gGenericMenu.unk10.i / 0x10000;
gGenericMenu.unk2a = gSave.kinstoneTypes[tmp3]; gGenericMenu.unk2a = gSave.kinstones.types[tmp3];
SetMenuType(3); SetMenuType(3);
} }
break; break;
@ -319,9 +319,9 @@ void KinstoneMenu_Type5(void) {
void KinstoneMenu_Type5_Overlay0(void) { void KinstoneMenu_Type5_Overlay0(void) {
gMenu.column_idx = 5; gMenu.column_idx = 5;
WriteBit(gSave.fusedKinstones, gFuseInfo.kinstoneId); WriteBit(gSave.kinstones.fusedKinstones, gFuseInfo.kinstoneId);
if (++gSave.fusedKinstoneCount > 99) { if (++gSave.kinstones.fusedCount > 99) {
gSave.didAllFusions = 1; gSave.kinstones.didAllFusions = 1;
} }
KinstoneMenu_080A4468(); KinstoneMenu_080A4468();
SoundReq(SFX_TASK_COMPLETE); SoundReq(SFX_TASK_COMPLETE);
@ -462,7 +462,7 @@ void KinstoneMenu_080A414C(void) {
OamCmd->x = ((ptr[((uVar1 & tmp1) + 0x40) & tmp1] * 0x42) / 0x100) - 0x10; OamCmd->x = ((ptr[((uVar1 & tmp1) + 0x40) & tmp1] * 0x42) / 0x100) - 0x10;
iVar2 = gKinstoneMenu.unk10.WORD / 0x10000 + i; iVar2 = gKinstoneMenu.unk10.WORD / 0x10000 + i;
if (iVar2 >= 0) { if (iVar2 >= 0) {
uVar3 = gSave.kinstoneAmounts[iVar2]; uVar3 = gSave.kinstones.amounts[iVar2];
if (i == 0) { if (i == 0) {
switch (gMenu.column_idx) { switch (gMenu.column_idx) {
case 3: case 3:
@ -474,7 +474,7 @@ void KinstoneMenu_080A414C(void) {
} }
} }
if (uVar3 > 0) { if (uVar3 > 0) {
sub_080A42E0(gSave.kinstoneTypes[iVar2], uVar3); sub_080A42E0(gSave.kinstones.types[iVar2], uVar3);
} }
} }
uVar1 += 0x17; uVar1 += 0x17;

View File

@ -666,7 +666,7 @@ void sub_080A5594(void) {
iVar5 = 0; iVar5 = 0;
if (GetInventoryValue(ITEM_KINSTONE_BAG) != 0) { if (GetInventoryValue(ITEM_KINSTONE_BAG) != 0) {
for (i = 0; i < 0x13; i++) { for (i = 0; i < 0x13; i++) {
iVar5 += gSave.kinstoneAmounts[i]; iVar5 += gSave.kinstones.amounts[i];
} }
if (iVar5 >= 0x50) { if (iVar5 >= 0x50) {
@ -1305,11 +1305,11 @@ void sub_080A6044(void) {
gOamCmd._6 = 0; gOamCmd._6 = 0;
uVar4 = 0; uVar4 = 0;
uVar2 = 0; uVar2 = 0;
uVar1 = gSave.kinstoneTypes[0]; uVar1 = gSave.kinstones.types[0];
while (uVar1 != 0) { while (uVar1 != 0) {
gOamCmd.x = (uVar4 & 3) * 0x30 + 0x2b; gOamCmd.x = (uVar4 & 3) * 0x30 + 0x2b;
gOamCmd.y = (uVar4 >> 2) * 0x24 + 0x34; gOamCmd.y = (uVar4 >> 2) * 0x24 + 0x34;
uVar3 = gSave.kinstoneAmounts[uVar2]; uVar3 = gSave.kinstones.amounts[uVar2];
gMenu.column_idx = 0; gMenu.column_idx = 0;
sub_080A42E0(uVar1, uVar3); sub_080A42E0(uVar1, uVar3);
uVar4++; uVar4++;
@ -1320,7 +1320,7 @@ void sub_080A6044(void) {
if (0x11 < uVar2) { if (0x11 < uVar2) {
return; return;
} }
uVar1 = gSave.kinstoneTypes[uVar2]; uVar1 = gSave.kinstones.types[uVar2];
} }
} }
} }

View File

@ -126,7 +126,7 @@ void sub_0806E65C(Entity* this) {
void Cucco_ShowMessage(Entity* this) { void Cucco_ShowMessage(Entity* this) {
u32 val = 0; u32 val = 0;
u32 index = GetFuserId(this); u32 index = GetFuserId(this);
if (gSave.fuserOffers[index] == KINSTONE_FUSER_DONE) { if (gSave.kinstones.fuserOffers[index] == KINSTONE_FUSER_DONE) {
val = 1; val = 1;
} }

View File

@ -44,7 +44,7 @@ void Din(DinEntity* this) {
void Din_MakeInteractable(Entity* this) { void Din_MakeInteractable(Entity* this) {
u32 kinstoneId = GetFusionToOffer(this); u32 kinstoneId = GetFusionToOffer(this);
if ((gSave.fuserProgress[GetFuserId(this)] != 0) && (gSave.global_progress < 7)) { if ((gSave.kinstones.fuserProgress[GetFuserId(this)] != 0) && (gSave.global_progress < 7)) {
kinstoneId = KINSTONE_NONE; kinstoneId = KINSTONE_NONE;
} }
AddInteractableWhenBigFuser(this, kinstoneId); AddInteractableWhenBigFuser(this, kinstoneId);

View File

@ -44,7 +44,7 @@ void Farore(FaroreEntity* this) {
void Farore_MakeInteractable(Entity* this) { void Farore_MakeInteractable(Entity* this) {
u32 kinstoneId = GetFusionToOffer(this); u32 kinstoneId = GetFusionToOffer(this);
if ((gSave.fuserProgress[GetFuserId(this)] != 0) && (gSave.global_progress < 7)) { if ((gSave.kinstones.fuserProgress[GetFuserId(this)] != 0) && (gSave.global_progress < 7)) {
kinstoneId = KINSTONE_NONE; kinstoneId = KINSTONE_NONE;
} }
AddInteractableWhenBigFuser(this, kinstoneId); AddInteractableWhenBigFuser(this, kinstoneId);

View File

@ -44,7 +44,7 @@ void Nayru(NayruEntity* this) {
void Nayru_MakeInteractable(Entity* this) { void Nayru_MakeInteractable(Entity* this) {
u32 kinstoneId = GetFusionToOffer(this); u32 kinstoneId = GetFusionToOffer(this);
if ((gSave.fuserProgress[GetFuserId(this)] != 0) && (gSave.global_progress < 7)) { if ((gSave.kinstones.fuserProgress[GetFuserId(this)] != 0) && (gSave.global_progress < 7)) {
kinstoneId = KINSTONE_NONE; kinstoneId = KINSTONE_NONE;
} }
AddInteractableWhenBigFuser(this, kinstoneId); AddInteractableWhenBigFuser(this, kinstoneId);

View File

@ -146,7 +146,7 @@ void sub_08064F28(Entity* this, ScriptExecutionContext* context) {
context->condition = 0; context->condition = 0;
roomFlag = gUnk_0810FC50[this->type]; roomFlag = gUnk_0810FC50[this->type];
if (CheckRoomFlag(roomFlag) == 0) { if (CheckRoomFlag(roomFlag) == 0) {
bVar2 = gSave.fuserProgress[GetFuserId(this)]; bVar2 = gSave.kinstones.fuserProgress[GetFuserId(this)];
if (bVar2 >= 2) { if (bVar2 >= 2) {
uVar5 = 3; uVar5 = 3;
} else { } else {
@ -163,7 +163,7 @@ void sub_08064F28(Entity* this, ScriptExecutionContext* context) {
remainingFusions = -1; remainingFusions = -1;
} else { } else {
if (CheckGlobalFlag(KAKERA_COMPLETE) == 0) { if (CheckGlobalFlag(KAKERA_COMPLETE) == 0) {
remainingFusions = 100 - gSave.fusedKinstoneCount; remainingFusions = 100 - gSave.kinstones.fusedCount;
if (remainingFusions < 1) { if (remainingFusions < 1) {
uVar5 = 8; uVar5 = 8;
remainingFusions = 0; remainingFusions = 0;

View File

@ -356,7 +356,7 @@ u32 UpdateFuseInteraction(Entity* entity) {
void MarkFuserDone(Entity* entity) { void MarkFuserDone(Entity* entity) {
u32 fuserId = GetFuserId(entity); u32 fuserId = GetFuserId(entity);
if (fuserId != 0) if (fuserId != 0)
gSave.fuserOffers[fuserId] = KINSTONE_FUSER_DONE; gSave.kinstones.fuserOffers[fuserId] = KINSTONE_FUSER_DONE;
} }
void ShowNPCDialogue(Entity* ent, const Dialog* dia) { void ShowNPCDialogue(Entity* ent, const Dialog* dia) {

View File

@ -214,7 +214,7 @@ void CuccoMinigame_WinItem(CuccoMinigameEntity* this) {
} }
break; break;
case ITEM_KINSTONE: case ITEM_KINSTONE:
if (gSave.didAllFusions) { if (gSave.kinstones.didAllFusions) {
skipItem = 1; skipItem = 1;
} }
break; break;

View File

@ -44,14 +44,14 @@ void Object37_Init(Object37Entity* this) {
void Object37_Action1(Object37Entity* this) { void Object37_Action1(Object37Entity* this) {
Entity* item; Entity* item;
if ((gSave.fusionUnmarked[0] != 0) && (this->unk70 != *this->unk78)) { if ((gSave.kinstones.fusionUnmarked[0] != 0) && (this->unk70 != *this->unk78)) {
item = CreateGroundItem(super, ITEM_RUPEE100, 0); item = CreateGroundItem(super, ITEM_RUPEE100, 0);
if (item != 0) { if (item != 0) {
item->direction = gPlayerEntity.animationState << 2; item->direction = gPlayerEntity.animationState << 2;
item->speed = 0x80; item->speed = 0x80;
item->zVelocity = Q_16_16(2.0); item->zVelocity = Q_16_16(2.0);
} }
gSave.fusionUnmarked[0] = 1; gSave.kinstones.fusionUnmarked[0] = 1;
DeleteThisEntity(); DeleteThisEntity();
} }
} }

View File

@ -1113,7 +1113,7 @@ bool32 sub_080782C0(void) {
if (((gPlayerState.playerInput.newInput & PLAYER_INPUT_1000) != 0) && if (((gPlayerState.playerInput.newInput & PLAYER_INPUT_1000) != 0) &&
((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) { ((u8)(gPossibleInteraction.currentObject->kinstoneId - 1) < 100)) {
AddKinstoneToBag(KINSTONE_NONE); AddKinstoneToBag(KINSTONE_NONE);
if (gSave.kinstoneAmounts[0] != 0) { if (gSave.kinstones.amounts[0] != 0) {
gPossibleInteraction.kinstoneId = gPossibleInteraction.currentObject->kinstoneId; gPossibleInteraction.kinstoneId = gPossibleInteraction.currentObject->kinstoneId;
gPossibleInteraction.currentObject->entity->interactType = INTERACTION_FUSE; gPossibleInteraction.currentObject->entity->interactType = INTERACTION_FUSE;
gPlayerState.queued_action = PLAYER_08070E9C; gPlayerState.queued_action = PLAYER_08070E9C;