mirror of
				https://github.com/coop-deluxe/sm64coopdx.git
				synced 2025-10-30 08:01:01 +00:00 
			
		
		
		
	Allow toggling the false ledge grab fix
This commit is contained in:
		
							parent
							
								
									cc1ca691ad
								
							
						
					
					
						commit
						def1122159
					
				
					 10 changed files with 13 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,5 @@
 | 
			
		|||
math.randomseed(get_time())
 | 
			
		||||
 | 
			
		||||
_CObject = {
 | 
			
		||||
    __index = function (t,k)
 | 
			
		||||
        return _get_field(t['_lot'], t['_pointer'], k, t)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,7 @@
 | 
			
		|||
-- AUTOGENERATED FOR CODE EDITORS --
 | 
			
		||||
 | 
			
		||||
math.randomseed(get_time())
 | 
			
		||||
 | 
			
		||||
_CObject = {
 | 
			
		||||
    __index = function (t,k)
 | 
			
		||||
        return _get_field(t['_lot'], t['_pointer'], k, t)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -649,6 +649,7 @@
 | 
			
		|||
--- @field public exitCastleWarpNode integer
 | 
			
		||||
--- @field public extendedPauseDisplay integer
 | 
			
		||||
--- @field public fixCollisionBugs integer
 | 
			
		||||
--- @field public fixCollisionBugsFalseLedgeGrab integer
 | 
			
		||||
--- @field public fixCollisionBugsRoundedCorners integer
 | 
			
		||||
--- @field public fixVanishFloors integer
 | 
			
		||||
--- @field public floatingStarDance integer
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -955,6 +955,7 @@
 | 
			
		|||
| exitCastleWarpNode | `integer` |  |
 | 
			
		||||
| extendedPauseDisplay | `integer` |  |
 | 
			
		||||
| fixCollisionBugs | `integer` |  |
 | 
			
		||||
| fixCollisionBugsFalseLedgeGrab | `integer` |  |
 | 
			
		||||
| fixCollisionBugsRoundedCorners | `integer` |  |
 | 
			
		||||
| fixVanishFloors | `integer` |  |
 | 
			
		||||
| floatingStarDance | `integer` |  |
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,6 +44,7 @@ extern Trajectory sThiTinyMetalBallTraj[];
 | 
			
		|||
struct LevelValues gDefaultLevelValues = {
 | 
			
		||||
    .fixCollisionBugs               = 0,
 | 
			
		||||
    .fixCollisionBugsRoundedCorners = 1,
 | 
			
		||||
    .fixCollisionBugsFalseLedgeGrab = 1,
 | 
			
		||||
    .fixVanishFloors                = 0,
 | 
			
		||||
    .hudCapTimer                    = 0,
 | 
			
		||||
    .hudRedCoinsRadar               = 0,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -42,6 +42,7 @@ struct StarPositions {
 | 
			
		|||
struct LevelValues {
 | 
			
		||||
    u8 fixCollisionBugs;
 | 
			
		||||
    u8 fixCollisionBugsRoundedCorners;
 | 
			
		||||
    u8 fixCollisionBugsFalseLedgeGrab;
 | 
			
		||||
    u8 wingCapLookUpReq;
 | 
			
		||||
    u8 fixVanishFloors;
 | 
			
		||||
    u8 hudCapTimer;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -403,6 +403,7 @@ void set_mario_initial_action(struct MarioState *m, u32 spawnType, u32 actionArg
 | 
			
		|||
 | 
			
		||||
void init_mario_after_warp(void) {
 | 
			
		||||
    struct ObjectWarpNode *spawnNode = area_get_warp_node(sWarpDest.nodeId);
 | 
			
		||||
    if (spawnNode == NULL) { LOG_ERROR("Failed to find spawn node: %u", sWarpDest.nodeId); }
 | 
			
		||||
    if (spawnNode == NULL || spawnNode->object == NULL) { spawnNode = area_get_warp_node(0xFA); }
 | 
			
		||||
    if (spawnNode == NULL || spawnNode->object == NULL) { spawnNode = area_get_warp_node(0x00); }
 | 
			
		||||
    if (spawnNode == NULL || spawnNode->object == NULL) { spawnNode = area_get_any_warp_node(); }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -418,7 +418,7 @@ u32 check_ledge_grab(struct MarioState *m, struct Surface *wall, Vec3f intendedP
 | 
			
		|||
    ledgePos[2] = nextPos[2] - wall->normal.z * 60.0f;
 | 
			
		||||
    ledgePos[1] = find_floor(ledgePos[0], nextPos[1] + 160.0f, ledgePos[2], &ledgeFloor);
 | 
			
		||||
 | 
			
		||||
    if (gLevelValues.fixCollisionBugs) {
 | 
			
		||||
    if (gLevelValues.fixCollisionBugs && gLevelValues.fixCollisionBugsFalseLedgeGrab) {
 | 
			
		||||
        // fix false ledge grabs
 | 
			
		||||
        if (!ledgeFloor || ledgeFloor->normal.y < 0.90630779f) {
 | 
			
		||||
            return FALSE;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -741,7 +741,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 39
 | 
			
		||||
#define LUA_LEVEL_VALUES_FIELD_COUNT 40
 | 
			
		||||
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          },
 | 
			
		||||
| 
						 | 
				
			
			@ -752,6 +752,7 @@ static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] =
 | 
			
		|||
    { "exitCastleWarpNode",             LVT_U8,      offsetof(struct LevelValues, exitCastleWarpNode),             false, LOT_NONE          },
 | 
			
		||||
    { "extendedPauseDisplay",           LVT_U8,      offsetof(struct LevelValues, extendedPauseDisplay),           false, LOT_NONE          },
 | 
			
		||||
    { "fixCollisionBugs",               LVT_U8,      offsetof(struct LevelValues, fixCollisionBugs),               false, LOT_NONE          },
 | 
			
		||||
    { "fixCollisionBugsFalseLedgeGrab", LVT_U8,      offsetof(struct LevelValues, fixCollisionBugsFalseLedgeGrab), 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          },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
char gSmluaConstants[] = ""
 | 
			
		||||
"math.randomseed(get_time())"
 | 
			
		||||
"math.randomseed(get_time())\n"
 | 
			
		||||
"_CObject = {\n"
 | 
			
		||||
"    __index = function (t,k)\n"
 | 
			
		||||
"        return _get_field(t['_lot'], t['_pointer'], k, t)\n"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue