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