Force drop objects on instant warp

This commit is contained in:
MysterD 2022-03-29 22:34:48 -07:00
parent 51c1af7c68
commit 9d16605c3b
3 changed files with 11 additions and 3 deletions

View File

@ -30,6 +30,7 @@
#include "course_table.h"
#include "../../include/libc/stdlib.h"
#include "rumble_init.h"
#include "game/interaction.h"
#include "pc/pc_main.h"
#include "pc/cliopts.h"
@ -630,6 +631,7 @@ void check_instant_warp(void) {
//vec3f_mul(gMarioStates[0].vel, -0.8f);
return;
}
mario_drop_held_object(&gMarioStates[0]);
u8 changeOfArea = (gCurrAreaIndex != warp->area);
gMarioStates[0].pos[0] += warp->displacement[0];
gMarioStates[0].pos[1] += warp->displacement[1];

View File

@ -46,7 +46,7 @@ static void debug_warp_level1() {
}
static void debug_warp_level2() {
dynos_warp_to_level(LEVEL_HMC, 1, 1);
dynos_warp_to_level(LEVEL_WDW, 1, 1);
}
static void debug_grand_star(void) {

View File

@ -495,8 +495,14 @@ void network_send_object(struct Object* o) {
if (gNetworkType == NT_NONE || gNetworkPlayerLocal == NULL) { return; }
// sanity check SyncObject
if (!network_sync_object_initialized(o)) { LOG_ERROR("tried to send uninitialized sync obj"); return; }
if (o->behavior == bhvRespawner) { LOG_INFO("tried to send respawner sync obj"); return; }
if (!network_sync_object_initialized(o)) {
LOG_ERROR("tried to send uninitialized sync obj");
return;
}
if (o->behavior == bhvRespawner) {
LOG_INFO("tried to send respawner sync obj");
return;
}
struct SyncObject* so = &gSyncObjects[o->oSyncID];
if (so == NULL) { LOG_ERROR("tried to send null sync obj"); return; }