From f75cffb158193de4106a221e69a0d40cb0f28f92 Mon Sep 17 00:00:00 2001 From: Isaac <62234577+Isaac0-dev@users.noreply.github.com> Date: Tue, 12 Apr 2022 14:25:58 +1000 Subject: [PATCH] Small changes (#60) Prevented camera mode from being reset when someone else bubbles + more --- src/game/mario.c | 2 ++ src/game/mario_actions_automatic.c | 4 +++- src/game/mario_actions_cutscene.c | 2 +- src/pc/network/packets/packet_player.c | 12 ++++-------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/game/mario.c b/src/game/mario.c index 9875ce3d..daee68f2 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -1534,6 +1534,8 @@ void update_mario_inputs(struct MarioState *m) { gCurrActStarNum = 0; gCurrActNum = 0; gChangeLevel = 16; + m->health = 0x880; + play_transition(0x09, 0x14, 0x00, 0x00, 0x00); } if (m->playerIndex == 0) { diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index 9696a442..073c73a5 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -929,7 +929,9 @@ static void bubbled_offset_visual(struct MarioState* m) { } s32 act_bubbled(struct MarioState* m) { - set_camera_mode(m->area->camera, CAMERA_MODE_FREE_ROAM, 1); + if (m->playerIndex == 0) { + set_camera_mode(m->area->camera, CAMERA_MODE_FREE_ROAM, 1); + } struct MarioState* targetMarioState = nearest_mario_state_to_object(m->marioObj); struct Object* target = targetMarioState->marioObj; s32 angleToPlayer = obj_angle_to_object(m->marioObj, target); diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index ecbfef33..2f953e21 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -600,7 +600,7 @@ s32 act_debug_free_move(struct MarioState *m) { u32 action = ACT_IDLE; #ifndef DEVELOPMENT - if (gNetworkType == NT_SERVER && configEnableCheats == 0 && m->action == ACT_DEBUG_FREE_MOVE) { + if (gNetworkType == NT_SERVER && gServerSettings.enableCheats == 0 && m->action == ACT_DEBUG_FREE_MOVE) { if (m->pos[1] <= m->waterLevel - 100) { action = ACT_WATER_IDLE; } else { diff --git a/src/pc/network/packets/packet_player.c b/src/pc/network/packets/packet_player.c index 70363c04..916dd35e 100644 --- a/src/pc/network/packets/packet_player.c +++ b/src/pc/network/packets/packet_player.c @@ -362,14 +362,10 @@ void network_receive_player(struct Packet* p) { } #ifndef DEVELOPMENT - if (gNetworkType == NT_SERVER && configEnableCheats == 0) { - for (int i = 0; i < MAX_PLAYERS; i++) { - struct NetworkPlayer* np = &gNetworkPlayers[i]; - struct MarioState* m = &gMarioStates[np->localIndex]; - if (m->action == ACT_DEBUG_FREE_MOVE) { - network_send_kick(np->localIndex, EKT_CLOSE_CONNECTION); - network_player_disconnected(np->localIndex); - } + if (gNetworkType == NT_SERVER && gServerSettings.enableCheats == 0) { + if (m->action == ACT_DEBUG_FREE_MOVE) { + network_send_kick(np->localIndex, EKT_CLOSE_CONNECTION); + network_player_disconnected(np->localIndex); } } #endif