Fixed player-in-cutscene position/animations on late-join

This commit is contained in:
MysterD 2021-08-30 18:31:59 -07:00
parent 0ff729260d
commit 047bc94fd1
2 changed files with 11 additions and 2 deletions

View File

@ -460,6 +460,12 @@ s32 act_reading_npc_dialog(struct MarioState *m) {
m->actionState++; m->actionState++;
} }
if (m->playerIndex != 0 && gCurrentObject->header.gfx.unk38.animID == -1) {
// set animation
set_mario_animation(m, m->heldObj == NULL ? MARIO_ANIM_FIRST_PERSON
: MARIO_ANIM_IDLE_WITH_LIGHT_OBJ);
}
return FALSE; return FALSE;
} }
@ -869,7 +875,7 @@ s32 act_unlocking_key_door(struct MarioState *m) {
m->faceAngle[1] += 0x8000; m->faceAngle[1] += 0x8000;
} }
if (m->actionTimer == 0) { if ((m->actionTimer == 0) || (m->playerIndex != 0 && gCurrentObject->header.gfx.unk38.animID == -1)) {
spawn_obj_at_mario_rel_yaw(m, MODEL_BOWSER_KEY_CUTSCENE, bhvBowserKeyUnlockDoor, 0); spawn_obj_at_mario_rel_yaw(m, MODEL_BOWSER_KEY_CUTSCENE, bhvBowserKeyUnlockDoor, 0);
set_mario_animation(m, MARIO_ANIM_UNLOCK_DOOR); set_mario_animation(m, MARIO_ANIM_UNLOCK_DOOR);
} }

View File

@ -8,6 +8,7 @@
#include "game/area.h" #include "game/area.h"
#include "audio/external.h" #include "audio/external.h"
#include "engine/surface_collision.h" #include "engine/surface_collision.h"
#include "engine/math_util.h"
#include "game/object_list_processor.h" #include "game/object_list_processor.h"
#include "game/mario_misc.h" #include "game/mario_misc.h"
#include "pc/configfile.h" #include "pc/configfile.h"
@ -350,8 +351,10 @@ void network_receive_player(struct Packet* p) {
} }
// mark this player as visible // mark this player as visible
if (gNetworkAreaLoaded) { if (gNetworkAreaLoaded && !m->wasNetworkVisible) {
m->wasNetworkVisible = true; m->wasNetworkVisible = true;
vec3f_copy(m->marioObj->header.gfx.pos, m->pos);
vec3s_copy(m->marioObj->header.gfx.angle, m->faceAngle);
} }
} }