diff --git a/autogen/lua_definitions/structs.lua b/autogen/lua_definitions/structs.lua index f73fc0c4..a253aa43 100644 --- a/autogen/lua_definitions/structs.lua +++ b/autogen/lua_definitions/structs.lua @@ -653,6 +653,7 @@ --- @field public fixCollisionBugs integer --- @field public fixCollisionBugsFalseLedgeGrab integer --- @field public fixCollisionBugsGroundPoundBonks integer +--- @field public fixCollisionBugsPickBestWall integer --- @field public fixCollisionBugsRoundedCorners integer --- @field public fixVanishFloors integer --- @field public floatingStarDance integer diff --git a/docs/lua/structs.md b/docs/lua/structs.md index e8cd5799..e099b6a7 100644 --- a/docs/lua/structs.md +++ b/docs/lua/structs.md @@ -959,6 +959,7 @@ | fixCollisionBugs | `integer` | | | fixCollisionBugsFalseLedgeGrab | `integer` | | | fixCollisionBugsGroundPoundBonks | `integer` | | +| fixCollisionBugsPickBestWall | `integer` | | | fixCollisionBugsRoundedCorners | `integer` | | | fixVanishFloors | `integer` | | | floatingStarDance | `integer` | | diff --git a/src/game/hardcoded.c b/src/game/hardcoded.c index 53cb24ba..13263c4d 100644 --- a/src/game/hardcoded.c +++ b/src/game/hardcoded.c @@ -46,6 +46,7 @@ struct LevelValues gDefaultLevelValues = { .fixCollisionBugsRoundedCorners = 1, .fixCollisionBugsFalseLedgeGrab = 1, .fixCollisionBugsGroundPoundBonks = 1, + .fixCollisionBugsPickBestWall = 1, .fixVanishFloors = 0, .hudCapTimer = 0, .hudRedCoinsRadar = 0, diff --git a/src/game/hardcoded.h b/src/game/hardcoded.h index d9ee97db..98c7c583 100644 --- a/src/game/hardcoded.h +++ b/src/game/hardcoded.h @@ -44,6 +44,7 @@ struct LevelValues { u8 fixCollisionBugsRoundedCorners; u8 fixCollisionBugsFalseLedgeGrab; u8 fixCollisionBugsGroundPoundBonks; + u8 fixCollisionBugsPickBestWall; u8 wingCapLookUpReq; u8 fixVanishFloors; u8 hudCapTimer; diff --git a/src/game/mario.c b/src/game/mario.c index eb37c8e8..7e1584af 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -2385,7 +2385,7 @@ void set_mario_particle_flags(struct MarioState* m, u32 flags, u8 clear) { void mario_update_wall(struct MarioState* m, struct WallCollisionData* wcd) { if (!m || !wcd) { return; } - if (gLevelValues.fixCollisionBugs) { + if (gLevelValues.fixCollisionBugs && gLevelValues.fixCollisionBugsPickBestWall) { // turn face angle into a direction vector Vec3f faceAngle; faceAngle[0] = coss(m->faceAngle[0]) * sins(m->faceAngle[1]); diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c index 26aee3d0..a93e2276 100644 --- a/src/pc/lua/smlua_cobject_autogen.c +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -743,7 +743,7 @@ static struct LuaObjectField sLakituStateFields[LUA_LAKITU_STATE_FIELD_COUNT] = { "yaw", LVT_S16, offsetof(struct LakituState, yaw), false, LOT_NONE }, }; -#define LUA_LEVEL_VALUES_FIELD_COUNT 41 +#define LUA_LEVEL_VALUES_FIELD_COUNT 42 static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] = { { "cellHeightLimit", LVT_S16, offsetof(struct LevelValues, cellHeightLimit), false, LOT_NONE }, { "coinsRequiredForCoinStar", LVT_S16, offsetof(struct LevelValues, coinsRequiredForCoinStar), false, LOT_NONE }, @@ -756,6 +756,7 @@ static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] = { "fixCollisionBugs", LVT_U8, offsetof(struct LevelValues, fixCollisionBugs), false, LOT_NONE }, { "fixCollisionBugsFalseLedgeGrab", LVT_U8, offsetof(struct LevelValues, fixCollisionBugsFalseLedgeGrab), false, LOT_NONE }, { "fixCollisionBugsGroundPoundBonks", LVT_U8, offsetof(struct LevelValues, fixCollisionBugsGroundPoundBonks), false, LOT_NONE }, + { "fixCollisionBugsPickBestWall", LVT_U8, offsetof(struct LevelValues, fixCollisionBugsPickBestWall), false, LOT_NONE }, { "fixCollisionBugsRoundedCorners", LVT_U8, offsetof(struct LevelValues, fixCollisionBugsRoundedCorners), false, LOT_NONE }, { "fixVanishFloors", LVT_U8, offsetof(struct LevelValues, fixVanishFloors), false, LOT_NONE }, { "floatingStarDance", LVT_U8, offsetof(struct LevelValues, floatingStarDance), false, LOT_NONE },