Make level IDs s16s

This commit is contained in:
Agent X 2024-04-28 10:00:13 -04:00
parent 9cbf364113
commit 17348a8fc4
4 changed files with 10 additions and 10 deletions

View file

@ -1869,7 +1869,7 @@ s32 lvl_init_or_update(s16 initOrUpdate, UNUSED s32 unused) {
return result; return result;
} }
s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) { s32 lvl_init_from_save_file(UNUSED s16 arg0, s16 levelNum) {
#ifdef VERSION_EU #ifdef VERSION_EU
s16 var = eu_get_language(); s16 var = eu_get_language();
switch (var) { switch (var) {
@ -1907,7 +1907,7 @@ s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) {
return levelNum; return levelNum;
} }
s32 lvl_set_current_level(UNUSED s16 arg0, s32 levelNum) { s32 lvl_set_current_level(UNUSED s16 arg0, s16 levelNum) {
s32 warpCheckpointActive = sWarpCheckpointActive; s32 warpCheckpointActive = sWarpCheckpointActive;
sWarpCheckpointActive = FALSE; sWarpCheckpointActive = FALSE;

View file

@ -101,7 +101,7 @@ extern s16 gDelayedInitSound;
struct WarpDest { struct WarpDest {
u8 type; u8 type;
u8 levelNum; s16 levelNum;
u8 areaIdx; u8 areaIdx;
u8 nodeId; u8 nodeId;
u32 arg; u32 arg;
@ -176,8 +176,8 @@ void warp_special(s32 arg);
void initiate_warp(s16 destLevel, s16 destArea, s16 destWarpNode, s32 arg3); void initiate_warp(s16 destLevel, s16 destArea, s16 destWarpNode, s32 arg3);
s32 lvl_init_or_update(s16 initOrUpdate, UNUSED s32 unused); s32 lvl_init_or_update(s16 initOrUpdate, UNUSED s32 unused);
s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum); s32 lvl_init_from_save_file(UNUSED s16 arg0, s16 levelNum);
s32 lvl_set_current_level(UNUSED s16 arg0, s32 levelNum); s32 lvl_set_current_level(UNUSED s16 arg0, s16 levelNum);
s32 lvl_play_the_end_screen_sound(UNUSED s16 arg0, UNUSED s32 arg1); s32 lvl_play_the_end_screen_sound(UNUSED s16 arg0, UNUSED s32 arg1);
void basic_update(UNUSED s16 *arg); void basic_update(UNUSED s16 *arg);

View file

@ -107,7 +107,7 @@ struct Packet {
u16 orderedSeqId; u16 orderedSeqId;
u8 courseNum; u8 courseNum;
u8 actNum; u8 actNum;
u8 levelNum; s16 levelNum;
u8 areaIndex; u8 areaIndex;
u8 buffer[PACKET_LENGTH]; u8 buffer[PACKET_LENGTH];
}; };

View file

@ -62,7 +62,7 @@ void packet_init(struct Packet* packet, enum PacketType packetType, bool reliabl
if (packet->levelAreaMustMatch) { if (packet->levelAreaMustMatch) {
packet_write(packet, &gCurrCourseNum, sizeof(u8)); packet_write(packet, &gCurrCourseNum, sizeof(u8));
packet_write(packet, &gCurrActStarNum, sizeof(u8)); packet_write(packet, &gCurrActStarNum, sizeof(u8));
packet_write(packet, &gCurrLevelNum, sizeof(u8)); packet_write(packet, &gCurrLevelNum, sizeof(s16));
packet_write(packet, &gCurrAreaIndex, sizeof(u8)); packet_write(packet, &gCurrAreaIndex, sizeof(u8));
packet->courseNum = gCurrCourseNum; packet->courseNum = gCurrCourseNum;
packet->actNum = gCurrActStarNum; packet->actNum = gCurrActStarNum;
@ -71,7 +71,7 @@ void packet_init(struct Packet* packet, enum PacketType packetType, bool reliabl
} else if (packet->levelMustMatch) { } else if (packet->levelMustMatch) {
packet_write(packet, &gCurrCourseNum, sizeof(u8)); packet_write(packet, &gCurrCourseNum, sizeof(u8));
packet_write(packet, &gCurrActStarNum, sizeof(u8)); packet_write(packet, &gCurrActStarNum, sizeof(u8));
packet_write(packet, &gCurrLevelNum, sizeof(u8)); packet_write(packet, &gCurrLevelNum, sizeof(s16));
packet->courseNum = gCurrCourseNum; packet->courseNum = gCurrCourseNum;
packet->actNum = gCurrActStarNum; packet->actNum = gCurrActStarNum;
packet->levelNum = gCurrLevelNum; packet->levelNum = gCurrLevelNum;
@ -170,12 +170,12 @@ u8 packet_initial_read(struct Packet* packet) {
if (packet->levelAreaMustMatch) { if (packet->levelAreaMustMatch) {
packet_read(packet, &packet->courseNum, sizeof(u8)); packet_read(packet, &packet->courseNum, sizeof(u8));
packet_read(packet, &packet->actNum, sizeof(u8)); packet_read(packet, &packet->actNum, sizeof(u8));
packet_read(packet, &packet->levelNum, sizeof(u8)); packet_read(packet, &packet->levelNum, sizeof(s16));
packet_read(packet, &packet->areaIndex, sizeof(u8)); packet_read(packet, &packet->areaIndex, sizeof(u8));
} else if (packet->levelMustMatch) { } else if (packet->levelMustMatch) {
packet_read(packet, &packet->courseNum, sizeof(u8)); packet_read(packet, &packet->courseNum, sizeof(u8));
packet_read(packet, &packet->actNum, sizeof(u8)); packet_read(packet, &packet->actNum, sizeof(u8));
packet_read(packet, &packet->levelNum, sizeof(u8)); packet_read(packet, &packet->levelNum, sizeof(s16));
} }
// don't drop packet // don't drop packet