Skip to content

Commit

Permalink
Trying to resolve only one roamer moving on pokedex
Browse files Browse the repository at this point in the history
  • Loading branch information
ElwinBran committed May 2, 2024
1 parent 69567c4 commit 24bbb82
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions src/roamer.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,30 +129,35 @@ void UpdateLocationHistoryForRoamer(void)
}
}

void RoamerMoveToOtherLocationSet(void)
void SlotRoamerMoveToOtherLocationSet(u8 slot)
{
u8 mapNum = 0;
u32 i;

// Choose a location set that starts with a map
// different from the roamer's current map
for (i = 0; i < MAX_ROAMERS; i++)
if (GetRoamer(slot)->active)
{
if (GetRoamer(i)->active)
while (1)
{
while (1)
mapNum = sRoamerLocations[Random() % NUM_LOCATION_SETS][0];
if (sRoamerLocation[slot][MAP_NUM] != mapNum)
{
mapNum = sRoamerLocations[Random() % NUM_LOCATION_SETS][0];
if (sRoamerLocation[i][MAP_NUM] != mapNum)
{
sRoamerLocation[i][MAP_NUM] = mapNum;
return;
}
sRoamerLocation[slot][MAP_NUM] = mapNum;
return;
}
}
}
}


void RoamerMoveToOtherLocationSet(void)
{
u32 i;
for (i = 0; i < MAX_ROAMERS; i++)
{
SlotRoamerMoveToOtherLocationSet(i);
}
}

void RoamerMove(void)
{
u32 i; //roamer slot
Expand All @@ -163,7 +168,7 @@ void RoamerMove(void)
continue;
if ((Random() % 16) == 0)
{
RoamerMoveToOtherLocationSet();
SlotRoamerMoveToOtherLocationSet(i);
}
else
{
Expand Down

0 comments on commit 24bbb82

Please sign in to comment.