mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-04-23 07:27:20 +00:00
fix: boat plr height & sneak height (#1459)
This commit is contained in:
parent
e4c08b8414
commit
8bf0343544
|
|
@ -241,7 +241,7 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
|
|||
|
||||
if (riding)
|
||||
{
|
||||
if(uiBitmaskOverrideAnim&(1<<eAnim_SmallModel) == 0)
|
||||
if ((uiBitmaskOverrideAnim&(1<<eAnim_SmallModel)) == 0)
|
||||
{
|
||||
arm0->xRot += -HALF_PI * 0.4f;
|
||||
arm1->xRot += -HALF_PI * 0.4f;
|
||||
|
|
|
|||
|
|
@ -287,6 +287,20 @@ void ItemInHandRenderer::renderItem(shared_ptr<LivingEntity> mob, shared_ptr<Ite
|
|||
float xo = 0.0f;
|
||||
float yo = 0.3f;
|
||||
|
||||
|
||||
// Re position height of held item if skin is small
|
||||
if (mob->getAnimOverrideBitmask() & (1 << HumanoidModel::eAnim_SmallModel))
|
||||
{
|
||||
if (mob->isRiding())
|
||||
{
|
||||
std::shared_ptr<Entity> ridingEntity = mob->riding;
|
||||
if (ridingEntity != nullptr) // Safety check;
|
||||
{
|
||||
yo += 0.3f; // reverts the change in Boat.cpp for smaller models.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glEnable(GL_RESCALE_NORMAL);
|
||||
glTranslatef(-xo, -yo, 0);
|
||||
float s = 1.5f;
|
||||
|
|
|
|||
|
|
@ -199,11 +199,26 @@ void PlayerRenderer::render(shared_ptr<Entity> _mob, double x, double y, double
|
|||
armorParts1->sneaking = armorParts2->sneaking = humanoidModel->sneaking = mob->isSneaking();
|
||||
|
||||
double yp = y - mob->heightOffset;
|
||||
if (mob->isSneaking() && !mob->instanceof(eTYPE_LOCALPLAYER))
|
||||
if (mob->isSneaking())
|
||||
{
|
||||
yp -= 2 / 16.0f;
|
||||
}
|
||||
|
||||
if (mob->getAnimOverrideBitmask() & (1 << HumanoidModel::eAnim_SmallModel))
|
||||
{
|
||||
if (mob->isRiding())
|
||||
{
|
||||
std::shared_ptr<Entity> ridingEntity = mob->riding;
|
||||
if (ridingEntity != nullptr) // Safety check;
|
||||
{
|
||||
if (ridingEntity->instanceof(eTYPE_BOAT))
|
||||
{
|
||||
yp += 0.25f; // reverts the change in Boat.cpp for smaller models.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if an idle animation is needed
|
||||
if(mob->getAnimOverrideBitmask()&(1<<HumanoidModel::eAnim_HasIdle))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ Boat::Boat(Level *level, double x, double y, double z) : Entity( level )
|
|||
|
||||
double Boat::getRideHeight()
|
||||
{
|
||||
return heightOffset;
|
||||
return heightOffset - 0.4f;
|
||||
}
|
||||
|
||||
bool Boat::hurt(DamageSource *source, float hurtDamage)
|
||||
|
|
|
|||
Loading…
Reference in a new issue