Renamed functions to match current pret counterparts, changed IsElevationMismatchAt to non-static
This commit is contained in:
parent
e1021af6bd
commit
3c2bf0b0f3
3 changed files with 11 additions and 11 deletions
|
@ -253,6 +253,7 @@ u8 GetSlideMovementAction(u32);
|
|||
u8 GetJumpMovementAction(u32);
|
||||
u8 GetJump2MovementAction(u32);
|
||||
u8 CreateCopySpriteAt(struct Sprite *sprite, s16 x, s16 y, u8 subpriority);
|
||||
bool8 IsElevationMismatchAt(u8, s16, s16);
|
||||
|
||||
u8 MovementType_WanderAround_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementType_WanderAround_Step1(struct ObjectEvent *, struct Sprite *);
|
||||
|
|
18
src/dexnav.c
18
src/dexnav.c
|
@ -668,12 +668,12 @@ static bool8 DexNavPickTile(u8 environment, u8 areaX, u8 areaY, bool8 smallScan)
|
|||
break; //occurs at same z coord
|
||||
|
||||
scale = 440 - (smallScan * 200) - (GetPlayerDistance(topX, topY) / 2) - (2 * (topX + topY));
|
||||
weight = ((Random() % scale) < 1) && !MapGridIsImpassableAt(topX, topY);
|
||||
weight = ((Random() % scale) < 1) && !MapGridGetCollisionAt(topX, topY);
|
||||
}
|
||||
else
|
||||
{ // outdoors: grass
|
||||
scale = 100 - (GetPlayerDistance(topX, topY) * 2);
|
||||
weight = (Random() % scale <= 5) && !MapGridIsImpassableAt(topX, topY);
|
||||
weight = (Random() % scale <= 5) && !MapGridGetCollisionAt(topX, topY);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -684,7 +684,7 @@ static bool8 DexNavPickTile(u8 environment, u8 areaX, u8 areaY, bool8 smallScan)
|
|||
if (IsElevationMismatchAt(gObjectEvents[gPlayerAvatar.spriteId].currentElevation, topX, topY))
|
||||
break;
|
||||
|
||||
weight = (Random() % scale <= 1) && !MapGridIsImpassableAt(topX, topY);
|
||||
weight = (Random() % scale <= 1) && !MapGridGetCollisionAt(topX, topY);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -862,7 +862,7 @@ static void Task_InitDexNavSearch(u8 taskId)
|
|||
{
|
||||
Free(sDexNavSearchDataPtr);
|
||||
FreeMonIconPalettes();
|
||||
ScriptContext1_SetupScript(EventScript_TooDark);
|
||||
ScriptContext_SetupScript(EventScript_TooDark);
|
||||
DestroyTask(taskId);
|
||||
return;
|
||||
}
|
||||
|
@ -871,7 +871,7 @@ static void Task_InitDexNavSearch(u8 taskId)
|
|||
{
|
||||
Free(sDexNavSearchDataPtr);
|
||||
FreeMonIconPalettes();
|
||||
ScriptContext1_SetupScript(EventScript_NotFoundNearby);
|
||||
ScriptContext_SetupScript(EventScript_NotFoundNearby);
|
||||
DestroyTask(taskId);
|
||||
return;
|
||||
}
|
||||
|
@ -993,7 +993,7 @@ static void EndDexNavSearchSetupScript(const u8 *script, u8 taskId)
|
|||
{
|
||||
gSaveBlock1Ptr->dexNavChain = 0; //reset chain
|
||||
EndDexNavSearch(taskId);
|
||||
ScriptContext1_SetupScript(script);
|
||||
ScriptContext_SetupScript(script);
|
||||
}
|
||||
|
||||
static u8 GetMovementProximityBySearchLevel(void)
|
||||
|
@ -1081,7 +1081,7 @@ static void Task_DexNavSearch(u8 taskId)
|
|||
return;
|
||||
}
|
||||
|
||||
if (ScriptContext2_IsEnabled() == TRUE)
|
||||
if (ArePlayerFieldControlsLocked() == TRUE)
|
||||
{ // check if script just executed
|
||||
//gSaveBlock1Ptr->dexNavChain = 0; //issue with reusable repels
|
||||
EndDexNavSearch(taskId);
|
||||
|
@ -1104,7 +1104,7 @@ static void Task_DexNavSearch(u8 taskId)
|
|||
|
||||
FlagClear(FLAG_SYS_DEXNAV_SEARCH);
|
||||
gDexnavBattle = TRUE;
|
||||
ScriptContext1_SetupScript(EventScript_StartDexNavBattle);
|
||||
ScriptContext_SetupScript(EventScript_StartDexNavBattle);
|
||||
Free(sDexNavSearchDataPtr);
|
||||
DestroyTask(taskId);
|
||||
return;
|
||||
|
@ -1868,7 +1868,7 @@ static void CB1_InitDexNavSearch(void)
|
|||
{
|
||||
u8 taskId;
|
||||
|
||||
if (!gPaletteFade.active && !ScriptContext2_IsEnabled() && gMain.callback2 == CB2_Overworld)
|
||||
if (!gPaletteFade.active && !ArePlayerFieldControlsLocked() && gMain.callback2 == CB2_Overworld)
|
||||
{
|
||||
SetMainCallback1(CB1_Overworld);
|
||||
taskId = CreateTask(Task_InitDexNavSearch, 0);
|
||||
|
|
|
@ -163,7 +163,6 @@ static u8 DoJumpSpecialSpriteMovement(struct Sprite *);
|
|||
static void CreateLevitateMovementTask(struct ObjectEvent *);
|
||||
static void DestroyLevitateMovementTask(u8);
|
||||
static bool8 NpcTakeStep(struct Sprite *);
|
||||
static bool8 IsElevationMismatchAt(u8, s16, s16);
|
||||
static bool8 AreElevationsCompatible(u8, u8);
|
||||
|
||||
static const struct SpriteFrameImage sPicTable_PechaBerryTree[];
|
||||
|
@ -7675,7 +7674,7 @@ static void SetObjectEventSpriteOamTableForLongGrass(struct ObjectEvent *objEven
|
|||
sprite->subspriteTableNum = 5;
|
||||
}
|
||||
|
||||
static bool8 IsElevationMismatchAt(u8 elevation, s16 x, s16 y)
|
||||
bool8 IsElevationMismatchAt(u8 elevation, s16 x, s16 y)
|
||||
{
|
||||
u8 mapElevation;
|
||||
|
||||
|
|
Loading…
Reference in a new issue