- 3
- Posts
- 4
- Years
- Seen Apr 9, 2023
I apologize if this is too big of an ask, but I'm a novice when it comes to resolving merge conflicts, and would appreciate any guidance on these. These occurred when incorporating this into DizzyEgg's stuff. I've included my thoughts on each, to explain where my logic takes me. I guess it's not really important to explain, but I want to show a good effort that I'm trying to learn.
In
This one baffles me because it doesn't seem like the bits of code actually conflict with each other at all.
In
This one seems related to
. My very hazy guess is that both "TryDoDoubleWildBattle" and "ChooseHiddenMonIndex" etc. need to be defined somehow, and they're taking up the same space? I'm probably really off, but that's what my amateurish intuition tells me.
In
I'm assuming this is mainly about generating shinies, but I don't see why these conflict. Is it because merging them is making the if-statements nest incorrectly, perhaps?
In
I'm wondering if this the root of why
was breaking.
In
My first thought was that these "struct" lines are trying to take the same place in the data, and I just need to make room for them all somehow?
Finally, in
I have no idea about this one.
Aside from these, there were a couple (namely
and
where I think the solution was just to replace the old code with the new code.
Anyway, I would appreciate any guidance on these, as well as any further explanation for what the code does and why it conflicts.
In
Code:
wild_encounter.c
Spoiler:
Code:
<<<<<<< HEAD
bool8 TryDoDoubleWildBattle(void)
{
if (GetSafariZoneFlag() || GetMonsStateToDoubles() != PLAYER_HAS_TWO_USABLE_MONS)
return FALSE;
else if (B_FLAG_FORCE_DOUBLE_WILD != 0 && FlagGet(B_FLAG_FORCE_DOUBLE_WILD))
return TRUE;
#if B_DOUBLE_WILD_CHANCE != 0
else if ((Random() % 100) + 1 < B_DOUBLE_WILD_CHANCE)
return TRUE;
#endif
return FALSE;
}
=======
u8 ChooseHiddenMonIndex(void)
{
#ifdef ENCOUNTER_CHANCE_HIDDEN_MONS_TOTAL
u8 rand = Random() % ENCOUNTER_CHANCE_HIDDEN_MONS_TOTAL;
if (rand < ENCOUNTER_CHANCE_HIDDEN_MONS_SLOT_0)
return 0;
else if (rand >= ENCOUNTER_CHANCE_HIDDEN_MONS_SLOT_0 && rand < ENCOUNTER_CHANCE_HIDDEN_MONS_SLOT_1)
return 1;
else
return 2;
#else
return 0xFF;
#endif
}
>>>>>>> 53e6ba1c4867d00813062981ff15a9ca02209dd8
This one baffles me because it doesn't seem like the bits of code actually conflict with each other at all.
In
Code:
wild_encounter.h
Spoiler:
Code:
<<<<<<< HEAD
bool8 TryDoDoubleWildBattle(void);
=======
void CreateWildMon(u16 species, u8 level);
u16 GetCurrentMapWildMonHeaderId(void);
u8 ChooseWildMonIndex_Land(void);
u8 ChooseWildMonIndex_WaterRock(void);
u8 ChooseHiddenMonIndex(void);
>>>>>>> 53e6ba1c4867d00813062981ff15a9ca02209dd8
This one seems related to
Code:
wild_encounter.c
In
Code:
pokemon.c
Spoiler:
Code:
<<<<<<< HEAD
| (gSaveBlock2Ptr->playerTrainerId[1] << 8)
| (gSaveBlock2Ptr->playerTrainerId[2] << 16)
| (gSaveBlock2Ptr->playerTrainerId[3] << 24);
if (CheckBagHasItem(ITEM_SHINY_CHARM, 1))
{
u32 shinyValue;
u32 rolls = 0;
do
{
personality = Random32();
shinyValue = HIHALF(value) ^ LOHALF(value) ^ HIHALF(personality) ^ LOHALF(personality);
rolls++;
} while (shinyValue >= SHINY_ODDS && rolls < I_SHINY_CHARM_REROLLS);
}
}
=======
| (gSaveBlock2Ptr->playerTrainerId[1] << 8)
| (gSaveBlock2Ptr->playerTrainerId[2] << 16)
| (gSaveBlock2Ptr->playerTrainerId[3] << 24);
if (FlagGet(FLAG_SHINY_CREATION))
{
u8 nature = personality % NUM_NATURES; // keep current nature
do {
personality = Random32();
personality = ((((Random() % SHINY_ODDS) ^ (HIHALF(value) ^ LOHALF(value))) ^ LOHALF(personality)) << 16) | LOHALF(personality);
} while (nature != GetNatureFromPersonality(personality));
}
}
>>>>>>> 53e6ba1c4867d00813062981ff15a9ca02209dd8
I'm assuming this is mainly about generating shinies, but I don't see why these conflict. Is it because merging them is making the if-statements nest incorrectly, perhaps?
In
Code:
pokemon.h
Spoiler:
Code:
<<<<<<< HEAD
u8 flags;
};
=======
/* 0x1A */ u8 abilityHidden;
}; /* size = 28 */
>>>>>>> 53e6ba1c4867d00813062981ff15a9ca02209dd8
I'm wondering if this the root of why
Code:
wild_encounter.h
In
Code:
global.h
Spoiler:
Code:
<<<<<<< HEAD
/*0x3???*/ u8 dexSeen[DEX_FLAGS_NO];
/*0x3???*/ u8 dexCaught[DEX_FLAGS_NO];
/*0x3???*/ u32 trainerHillTimes[4];
/*0x3???*/ struct RamScript ramScript;
/*0x3???*/ struct RecordMixingGift recordMixingGift;
/*0x3???*/ LilycoveLady lilycoveLady;
/*0x3???*/ struct TrainerNameRecord trainerNameRecords[20];
/*0x3???*/ u8 registeredTexts[UNION_ROOM_KB_ROW_COUNT][21];
/*0x3???*/ struct SaveTrainerHill trainerHill;
/*0x3???*/ struct WaldaPhrase waldaPhrase;
// sizeof: 0x3???
=======
/*0x3598*/ u8 field_3598[0x180];
/*0x3718*/ u32 trainerHillTimes[4];
/*0x3728*/ struct RamScript ramScript;
/*0x3B14*/ struct RecordMixingGift recordMixingGift;
/*0x3B24*/ u8 seen2[DEX_FLAGS_NO];
/*0x3B58*/ LilycoveLady lilycoveLady;
/*0x3B98*/ struct TrainerNameRecord trainerNameRecords[20];
/*0x3C88*/ u8 registeredTexts[UNION_ROOM_KB_ROW_COUNT][21];
/*0x3D5A*/ u8 filler3D5A[0xA];
/*0x3D64*/ struct SaveTrainerHill trainerHill;
/*0x3D70*/ struct WaldaPhrase waldaPhrase;
u8 dexNavSearchLevels[NUM_SPECIES];
u8 dexNavChain;
// sizeof: 0x3D88
>>>>>>> 53e6ba1c4867d00813062981ff15a9ca02209dd8
My first thought was that these "struct" lines are trying to take the same place in the data, and I just need to make room for them all somehow?
Finally, in
Code:
build.yml
Spoiler:
Code:
<<<<<<< HEAD
- name: Agbcc
run: make -j${nproc}
- name: Modern
run: make -j${nproc} modern
=======
- name: Compare
run: make -j${nproc} all syms
- name: Modern
env:
MODERN: 1
COMPARE: 0
run: make -j${nproc} all
- name: Webhook
if: ${{ github.event_name == 'push' }}
env:
CALCROM_DISCORD_WEBHOOK_USERNAME: OK
CALCROM_DISCORD_WEBHOOK_AVATAR_URL: https://i.imgur.com/38BQHdd.png
CALCROM_DISCORD_WEBHOOK_URL: ${{ secrets.CALCROM_DISCORD_WEBHOOK_URL }}
run: sh .github/calcrom/webhook.sh pokeemerald
- name: Move symfiles
if: ${{ github.event_name == 'push' }}
run: |
cp -v *.sym symbols/
- name: Update symfiles
if: ${{ github.event_name == 'push' }}
uses: EndBug/add-and-commit@v7
with:
branch: symbols
cwd: "./symbols"
add: "*.sym"
message: ${{ github.event.commits[0].message }}
>>>>>>> 53e6ba1c4867d00813062981ff15a9ca02209dd8
I have no idea about this one.
Aside from these, there were a couple (namely
Code:
battle_message.c
Code:
battle_main.c
Anyway, I would appreciate any guidance on these, as well as any further explanation for what the code does and why it conflicts.