diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c index a62abf3d3..589e6b857 100644 --- a/src/game/mario_misc.c +++ b/src/game/mario_misc.c @@ -509,11 +509,15 @@ Gfx* geo_mario_head_rotation(s32 callContext, struct GraphNode* node, UNUSED Mat struct MarioBodyState* bodyState = &gBodyStates[plrIdx]; s32 action = bodyState->action; + bool marioActive = gMarioObjects[plrIdx] != NULL && gMarioObjects[plrIdx]->activeFlags != ACTIVE_FLAG_DEACTIVATED; + if (callContext == GEO_CONTEXT_RENDER) { struct GraphNodeRotation* rotNode = (struct GraphNodeRotation*) node->next; struct Camera* camera = gCurGraphNodeCamera->config.camera; - if (camera->mode == CAMERA_MODE_C_UP) { + if (!marioActive) { + node->flags &= ~GRAPH_RENDER_ACTIVE; + } else if (camera->mode == CAMERA_MODE_C_UP) { rotNode->rotation[0] = gPlayerCameraState->headRotation[1]; rotNode->rotation[2] = gPlayerCameraState->headRotation[0]; } @@ -521,8 +525,7 @@ Gfx* geo_mario_head_rotation(s32 callContext, struct GraphNode* node, UNUSED Mat rotNode->rotation[0] = bodyState->headAngle[1]; rotNode->rotation[1] = bodyState->headAngle[2]; rotNode->rotation[2] = bodyState->headAngle[0]; - } - else { + } else { vec3s_set(bodyState->headAngle, 0, 0, 0); vec3s_set(rotNode->rotation, 0, 0, 0); } diff --git a/src/pc/network/packets/packet.c b/src/pc/network/packets/packet.c index c58fdab8a..e1f5cfb8e 100644 --- a/src/pc/network/packets/packet.c +++ b/src/pc/network/packets/packet.c @@ -12,8 +12,10 @@ void packet_process(struct Packet* p) { || p->areaIndex != gCurrAreaIndex); // drop packet if (levelAreaMismatch) { - LOG_INFO("dropping level mismatch packet %d", p->packetType); - LOG_INFO(" (%d, %d, %d, %d) != (%d, %d, %d, %d)", p->courseNum, p->actNum, p->levelNum, p->areaIndex, gCurrCourseNum, gCurrActNum, gCurrLevelNum, gCurrAreaIndex); + if (gNetworkType != NT_SERVER) { + LOG_INFO("dropping level mismatch packet %d", p->packetType); + LOG_INFO(" (%d, %d, %d, %d) != (%d, %d, %d, %d)", p->courseNum, p->actNum, p->levelNum, p->areaIndex, gCurrCourseNum, gCurrActNum, gCurrLevelNum, gCurrAreaIndex); + } return; } } diff --git a/src/pc/network/packets/packet_level.c b/src/pc/network/packets/packet_level.c index d9fe3a99f..b2c9917a3 100644 --- a/src/pc/network/packets/packet_level.c +++ b/src/pc/network/packets/packet_level.c @@ -28,6 +28,8 @@ void network_send_level(struct NetworkPlayer* toNp, bool sendArea) { packet_write(&p, &gRedCoinsCollected, sizeof(u8)); packet_write(&p, &gPssSlideStarted, sizeof(u8)); packet_write(&p, &gHudDisplay.timer, sizeof(u16)); + packet_write(&p, &gTTCSpeedSetting, sizeof(s16)); + packet_write(&p, gEnvironmentLevels, sizeof(s32)); // send level packet network_send_to(toNp->localIndex, &p); @@ -69,9 +71,11 @@ void network_receive_level(struct Packet* p) { // read level variables u8 redCoinsCollected; packet_read(p, &gMarioStates[0].numCoins, sizeof(s16)); - packet_read(p, &redCoinsCollected, sizeof(u8)); + packet_read(p, &redCoinsCollected, sizeof(u8)); packet_read(p, &gPssSlideStarted, sizeof(u8)); packet_read(p, &gHudDisplay.timer, sizeof(u16)); + packet_read(p, &gTTCSpeedSetting, sizeof(s16)); // likely doesn't work after level load.. but it could + packet_read(p, gEnvironmentLevels, sizeof(s32)); // hacky way to override red coins collected gRedCoinsCollected = redCoinsCollected; diff --git a/src/pc/network/packets/packet_player.c b/src/pc/network/packets/packet_player.c index 6a34e2331..d78b2fd72 100644 --- a/src/pc/network/packets/packet_player.c +++ b/src/pc/network/packets/packet_player.c @@ -190,7 +190,7 @@ void network_send_player(u8 localIndex) { read_packet_data(&data, &gMarioStates[localIndex]); struct Packet p; - packet_init(&p, PACKET_PLAYER, false, false); + packet_init(&p, PACKET_PLAYER, false, true); packet_write(&p, &gNetworkPlayers[localIndex].globalIndex, sizeof(u8)); packet_write(&p, &data, sizeof(struct PacketPlayerData)); network_send(&p);