diff --git a/src/menu/star_select.c b/src/menu/star_select.c index 17ac8a085..6810e2faa 100644 --- a/src/menu/star_select.c +++ b/src/menu/star_select.c @@ -154,6 +154,7 @@ void bhv_act_selector_init(void) { } render_100_coin_star(stars); + gInsidePainting = TRUE; } /** @@ -459,4 +460,9 @@ void star_select_finish_selection(void) { sLoadedActNum = sInitSelectedActNum; } gDialogCourseActNum = sSelectedActIndex + 1; + + gInsidePainting = FALSE; + if (gControlPainting) { + network_send_inside_painting(); + } } diff --git a/src/pc/network/packets/packet_inside_painting.c b/src/pc/network/packets/packet_inside_painting.c index 40fb80759..993207002 100644 --- a/src/pc/network/packets/packet_inside_painting.c +++ b/src/pc/network/packets/packet_inside_painting.c @@ -12,11 +12,10 @@ struct PacketDataInsidePainting { u8 controlPainting; u8 starIndex; u8 actIndex; - struct WarpNode warpNode; }; static clock_t lastSentTime = 0; -static float minUpdateRate = 0.5f; +static float minUpdateRate = 5.0f; static struct PacketDataInsidePainting lastSentData = { 0 }; static void populate_packet_data(struct PacketDataInsidePainting* data) { @@ -24,7 +23,6 @@ static void populate_packet_data(struct PacketDataInsidePainting* data) { data->controlPainting = gControlPainting; data->starIndex = sSelectableStarIndex; data->actIndex = sSelectedActIndex; - data->warpNode = gPaintingWarpNode; } void network_send_inside_painting(void) { @@ -55,24 +53,11 @@ void network_receive_inside_painting(struct Packet* p) { sSelectedActIndex = remote.actIndex; } - // see if the warp nodes are the same - int compareNodes = memcmp(&gPaintingWarpNode, &remote.warpNode, sizeof(struct WarpNode)); - - if (gControlPainting && !remote.controlPainting && (compareNodes == 0)) { + if (gControlPainting && !remote.controlPainting) { // remote is well behaved now, we can control the painting gWaitingForRemotePainting = false; } - bool shouldJumpInside = !gControlPainting && (!gInsidePainting && remote.insidePainting); - - // ERROR: THE DESTINATION MISMATCH DOESN'T MOVE THE CLIENT TO THE CORRECT SCREEN! - bool destinationMismatch = !gControlPainting && (compareNodes != 0); - - if (shouldJumpInside || destinationMismatch) { - initiate_painting_warp_node(&remote.warpNode, true); - set_play_mode(PLAY_MODE_CHANGE_LEVEL); - } - if (gControlPainting && !remote.controlPainting && !gInsidePainting && remote.insidePainting) { // we're in control and no longer in the painting, let remote know network_send_inside_painting(); @@ -94,4 +79,4 @@ void network_update_inside_painting(void) { if (compareData != 0 || timeSinceSend > minUpdateRate) { network_send_inside_painting(); } -} \ No newline at end of file +}