diff --git a/include/config.h b/include/config.h index 0e2c915e..4b004a50 100644 --- a/include/config.h +++ b/include/config.h @@ -60,6 +60,8 @@ #define DISABLE_LIVES // Disable AA (Recommended: it changes nothing on emulator, and it makes console run better) #define DISABLE_AA +// Fix instant warp offset not working when warping across different areas +#define INSTANT_WARP_OFFSET_FIX // Uncomment this if you want global star IDs (useful for creating an open world hack ala MVC) //#define GLOBAL_STAR_IDS // Uncomment this if you want to skip the title screen (Super Mario 64 logo) diff --git a/src/game/level_update.c b/src/game/level_update.c index da3cc880..c5f70407 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -29,6 +29,8 @@ #include "course_table.h" #include "rumble_init.h" +#include "config.h" + #define PLAY_MODE_NORMAL 0 #define PLAY_MODE_PAUSED 2 #define PLAY_MODE_CHANGE_AREA 3 @@ -557,7 +559,11 @@ void check_instant_warp(void) { gMarioState->marioObj->oPosX = gMarioState->pos[0]; gMarioState->marioObj->oPosY = gMarioState->pos[1]; gMarioState->marioObj->oPosZ = gMarioState->pos[2]; - + #ifdef INSTANT_WARP_OFFSET_FIX + gMarioObject->header.gfx.pos[0] = gMarioState->pos[0]; + gMarioObject->header.gfx.pos[1] = gMarioState->pos[1]; + gMarioObject->header.gfx.pos[2] = gMarioState->pos[2]; + #endif cameraAngle = gMarioState->area->camera->yaw; change_area(warp->area);