Skip to content

Fix: Pose Height/Animation Fixes#1149

Open
tylerreese543-lab wants to merge 2 commits intosmartcmd:mainfrom
tylerreese543-lab:sneak-height-fix
Open

Fix: Pose Height/Animation Fixes#1149
tylerreese543-lab wants to merge 2 commits intosmartcmd:mainfrom
tylerreese543-lab:sneak-height-fix

Conversation

@tylerreese543-lab
Copy link

@tylerreese543-lab tylerreese543-lab commented Mar 11, 2026

Description

Fixes the sneak height so the player doesn't float when they sneak. I might merge this with other fixes like boats in the future.

Fixes the boat height / animation for both large and small models.

Changes

Previous Behavior

Player floated when they crouched.

Player floated on boat, and legs were together.

Root Cause

Their height in the render script did not go down upon sneak.

Simply did not have the animation code proper.

New Behavior

Added that functionality.

Fixed the improper animation code. Sitting/Riding animations work properly, and small models are positioned correctly.

image image image

Fix Implementation

Replaced "yp" in PlayerRenderer::render, to go down upon sneak. I'm not entirely sure why it blocked sneaking in the first place.

Added a new bitmaskEnabled() function for getBitmaskOverride [localized, cleaned up, readability]
Re-worked boat riding
Added translation for item holding when small models are in a boat.

AI Use Disclosure

Related Issues

  • Fixes #[issue-number]
  • Related to #[issue-number]

@tylerreese543-lab tylerreese543-lab changed the title Fix Fix: Crouch float Mar 11, 2026
Fixed boat heights + small model item holding when on boats. Added boat height fix for small models.
@tylerreese543-lab tylerreese543-lab changed the title Fix: Crouch float Fix: Pose Height/Animation Fixes Mar 12, 2026
Copy link
Contributor

@3UR 3UR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should really only be 3 lines changed for this everything else is unnecessary.

_init(g,yOffset,texWidth,texHeight);
}

bool HumanoidModel::bitmaskEnabled(unsigned int uiBitmask, animbits bit)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed.


}
else if(uiBitmaskOverrideAnim&(1<<eAnim_ArmsOutFront))
else if(bitmaskEnabled(uiBitmaskOverrideAnim, eAnim_ArmsOutFront))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These originally work fine.

// Does the skin have an override for anim?

if(uiBitmaskOverrideAnim&(1<<eAnim_ArmsDown))
if(bitmaskEnabled(uiBitmaskOverrideAnim, eAnim_ArmsDown))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These originally work fine.

arm1->zRot = 0.0f;
}
else if(uiBitmaskOverrideAnim&(1<<eAnim_SingleArms))
else if(bitmaskEnabled(uiBitmaskOverrideAnim, eAnim_SingleArms))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These originally work fine.

}
// 4J-PB - Weeping Angel - does't look good holding something in the arm that's up
else if((uiBitmaskOverrideAnim&(1<<eAnim_StatueOfLiberty)) && (holdingRightHand==0) && (attackTime==0.0f))
else if(bitmaskEnabled(uiBitmaskOverrideAnim, eAnim_StatueOfLiberty) && (holdingRightHand==0) && (attackTime==0.0f))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These originally work fine.

{
if(uiBitmaskOverrideAnim&(1<<eAnim_SmallModel) == 0)
//Fix this later
if(bitmaskEnabled(uiBitmaskOverrideAnim, eAnim_SmallModel) || bitmaskEnabled(uiBitmaskOverrideAnim, eAnim_SingleLegs))
Copy link
Contributor

@3UR 3UR Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong too, I will attach a screenshot of how the fix should actually be done for riding (This was decompiled and is the exact fix 4J studios did.)

Image

leg1->yRot = -HALF_PI * 0.2f;
}
else if(uiBitmaskOverrideAnim&(1<<eAnim_NoLegAnim))
else if(bitmaskEnabled(uiBitmaskOverrideAnim, eAnim_NoLegAnim))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These originally work fine.

leg1->yRot = 0.0f;
}
else if(uiBitmaskOverrideAnim&(1<<eAnim_SingleLegs))
else if(bitmaskEnabled(uiBitmaskOverrideAnim, eAnim_SingleLegs))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These originally work fine.

arm0->yRot += body->yRot * 2.0f;

if((uiBitmaskOverrideAnim&(1<<eAnim_StatueOfLiberty))&& (holdingRightHand==0) && (attackTime==0.0f))
if(bitmaskEnabled(uiBitmaskOverrideAnim, eAnim_StatueOfLiberty) && (holdingRightHand==0) && (attackTime==0.0f))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These originally work fine.

if (sneaking)
{
if(uiBitmaskOverrideAnim&(1<<eAnim_SmallModel))
if(bitmaskEnabled(uiBitmaskOverrideAnim, eAnim_SmallModel))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These originally work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants