Merge branch 'master' into scrcmd

This commit is contained in:
Admiral-Fish 2022-05-06 16:42:05 -07:00 committed by GitHub
commit 8986317b7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 15 deletions

View File

@ -144,7 +144,7 @@ typedef struct Location {
int mapId;
int warpId;
int x;
int z;
int y;
int direction;
} Location;
@ -325,11 +325,11 @@ void ScriptReturn(SCRIPTCONTEXT* ctx);
u16 ScriptReadHalfword(SCRIPTCONTEXT* ctx);
u32 ScriptReadWord(SCRIPTCONTEXT* ctx);
static inline void InitLocation(Location *location, int mapId, int warpId, int x, int z, int direction) {
static inline void InitLocation(Location *location, int mapId, int warpId, int x, int y, int direction) {
location->mapId = mapId;
location->warpId = warpId;
location->x = x;
location->z = z;
location->y = y;
location->direction = direction;
}

View File

@ -9,7 +9,7 @@ BOOL CheckUseEscapeRopeInAlphChamber(FieldSystem* fsys) {
return FALSE;
}
if (position->x != 6 || position->z != 3 || position->direction != DIR_NORTH) {
if (position->x != 6 || position->y != 3 || position->direction != DIR_NORTH) {
return FALSE;
}
@ -23,7 +23,7 @@ BOOL CheckUseFlashInAlphChamber(FieldSystem* fsys) {
return FALSE;
}
if (position->x != 6 || position->z != 3 || position->direction != DIR_NORTH) {
if (position->x != 6 || position->y != 3 || position->direction != DIR_NORTH) {
return FALSE;
}
@ -37,7 +37,7 @@ BOOL CheckUseWaterStoneInAlphChamber(FieldSystem* fsys) {
return FALSE;
}
if (position->x != 6 || position->z != 3 || position->direction != DIR_NORTH) {
if (position->x != 6 || position->y != 3 || position->direction != DIR_NORTH) {
return FALSE;
}

View File

@ -149,7 +149,7 @@ static void sub_02052F94(FieldSystem *fsys, Location *location) {
if (fsys->location->warpId != -1) {
warp = Field_GetWarpEventI(fsys, fsys->location->warpId);
fsys->location->x = warp->x;
fsys->location->z = warp->y;
fsys->location->y = warp->y;
if (warp->anchor == 0x100) {
*FlyPoints_GetDynamicWarp(flypointsSave) = *sub_0203B95C(flypointsSave);
}
@ -221,13 +221,13 @@ static void sub_0205316C(FieldSystem *fsys) {
if (fsys->unkAC) {
gender = PlayerProfile_GetTrainerGender(Sav2_PlayerData_GetProfileAddr(fsys->savedata));
avatar_sub = SaveFlyPoints_GetPlayerSub(Save_FlyPoints_get(fsys->savedata));
fsys->playerAvatar = sub_0205C390(fsys->mapObjectMan, fsys->location->x, fsys->location->z, fsys->location->direction, avatar_sub->unk4, gender, 2, avatar_sub);
fsys->playerAvatar = sub_0205C390(fsys->mapObjectMan, fsys->location->x, fsys->location->y, fsys->location->direction, avatar_sub->unk4, gender, 2, avatar_sub);
} else {
fsys->mapObjectMan = sub_0205E0BC(fsys, 64, 5);
gender = PlayerProfile_GetTrainerGender(Sav2_PlayerData_GetProfileAddr(fsys->savedata));
avatar_sub = SaveFlyPoints_GetPlayerSub(Save_FlyPoints_get(fsys->savedata));
fsys->playerAvatar = sub_0205C390(fsys->mapObjectMan, fsys->location->x, fsys->location->z, fsys->location->direction, avatar_sub->unk4, gender, 2, avatar_sub);
sub_020699F8(fsys->mapObjectMan, fsys->location->x, fsys->location->z, fsys->location->direction, fsys->location->mapId);
fsys->playerAvatar = sub_0205C390(fsys->mapObjectMan, fsys->location->x, fsys->location->y, fsys->location->direction, avatar_sub->unk4, gender, 2, avatar_sub);
sub_020699F8(fsys->mapObjectMan, fsys->location->x, fsys->location->y, fsys->location->direction, fsys->location->mapId);
Field_InitMapObjectsFromZoneEventData(fsys);
sub_0205F55C(fsys->mapObjectMan);
}
@ -300,12 +300,12 @@ static void _CopyPlayerPosToLocationWorkFacingSouth(Location *location, FieldSys
static BOOL _IsPlayerStandingInFrontOfUnionRoomReception(FieldSystem *fsys) {
if (MapHeader_MapIsPokemonCenter(fsys->location->mapId)
&& fsys->location->x == 6 && fsys->location->z == 6) {
&& fsys->location->x == 6 && fsys->location->y == 6) {
return TRUE;
}
if (MapHeader_MapIsPokemonLeagueLobby(fsys->location->mapId)
&& fsys->location->x == 3 && fsys->location->z == 15) {
&& fsys->location->x == 3 && fsys->location->y == 15) {
return TRUE;
}

View File

@ -2483,7 +2483,7 @@ BOOL ScrCmd_SetDynamicWarp(SCRIPTCONTEXT *ctx) {
warp.mapId = ScriptGetVar(ctx);
warp.warpId = ScriptGetVar(ctx);
warp.x = ScriptGetVar(ctx);
warp.z = ScriptGetVar(ctx);
warp.y = ScriptGetVar(ctx);
warp.direction = ScriptGetVar(ctx);
FlyPoints_SetDynamicWarp(Save_FlyPoints_get(ctx->fsys->savedata), &warp);
return FALSE;
@ -4092,7 +4092,7 @@ BOOL ScrCmd_582(SCRIPTCONTEXT *ctx) {
Location *specialSpawn = FlyPoints_GetSpecialSpawnWarpPtr(Save_FlyPoints_get(ctx->fsys->savedata));
specialSpawn->mapId = mapId;
specialSpawn->x = x;
specialSpawn->z = y;
specialSpawn->y = y;
specialSpawn->warpId = -1;
specialSpawn->direction = DIR_SOUTH;
return FALSE;

View File

@ -37,7 +37,7 @@ static void sub_02092BE8(FieldSystem* sys, Unk_PokegearSTRUCT_2C* ptr, BOOL a2)
ptr->mapHeader = ptr->mapID;
} else {
ptr->x = warpPtr->x;
ptr->y = warpPtr->z;
ptr->y = warpPtr->y;
MapHeader_GetWorldMapCoords(ptr->mapID, &Unk_struct.x, &Unk_struct.y);
MAPMATRIX* matrix = MapMatrix_New();
MapMatrix_Load(MAP_T20, matrix);