diff --git a/Minecraft.Client/Common/Consoles_App.cpp b/Minecraft.Client/Common/Consoles_App.cpp index db8373ec..09a07d6c 100644 --- a/Minecraft.Client/Common/Consoles_App.cpp +++ b/Minecraft.Client/Common/Consoles_App.cpp @@ -1486,6 +1486,7 @@ void CMinecraftApp::ApplyGameSettingsChanged(int iPad) ActionGameSettings(iPad,eGameSetting_ControlScheme ); ActionGameSettings(iPad,eGameSetting_ControlInvertLook); ActionGameSettings(iPad,eGameSetting_ControlSouthPaw); + ActionGameSettings(iPad,eGameSetting_ControlType); ActionGameSettings(iPad,eGameSetting_SplitScreenVertical); ActionGameSettings(iPad,eGameSetting_GamertagsVisible); diff --git a/Minecraft.Client/Common/UI/UIScene.cpp b/Minecraft.Client/Common/UI/UIScene.cpp index 7b69526a..49cf9c19 100644 --- a/Minecraft.Client/Common/UI/UIScene.cpp +++ b/Minecraft.Client/Common/UI/UIScene.cpp @@ -326,11 +326,11 @@ void UIScene::loadMovie() if(primaryPad < 0 || primaryPad >= XUSER_MAX_COUNT) primaryPad = 0; const int controlType = app.GetGameSettings(primaryPad, eGameSetting_ControlType); - const bool force720ForControlType = (controlType == 3 || controlType == 4 || controlType == 6); + const bool force720ForControlType = (controlType == 3 || controlType == 5); // tutorial popups + HUD elements have inaccuracies + crashes that we need to fix here const bool isTutorialPopupMovie = (moviePath.find(L"TutorialPopup") == 0); const bool isHUDMovie = (moviePath.find(L"HUD") == 0); - const bool use1080 = (ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie || isHUDMovie); + const bool use1080 = (ui.getScreenHeight() > 720.0f) && (!force720ForControlType || isTutorialPopupMovie); if(use1080) { moviePath.append(L"1080.swf"); diff --git a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp index f0d58217..133d6092 100644 --- a/Minecraft.Client/Windows64/Windows64_Minecraft.cpp +++ b/Minecraft.Client/Windows64/Windows64_Minecraft.cpp @@ -1510,6 +1510,7 @@ static Minecraft* InitialiseMinecraftRuntime() app.InitGameSettings(); app.InitialiseTips(); + ui.ReloadSkin(); return pMinecraft; } diff --git a/Minecraft.World/Entity.cpp b/Minecraft.World/Entity.cpp index b4f7524a..d5fdbc8c 100644 --- a/Minecraft.World/Entity.cpp +++ b/Minecraft.World/Entity.cpp @@ -356,6 +356,8 @@ void Entity::_init(bool useSmallId, Level *level) // 4J Added m_ignoreVerticalCollisions = false; + m_clearFallDamageThisTick = false; + m_ignoreFallDamageUntilGround = false; m_uiAnimOverrideBitmask = 0L; m_ignorePortal = false; } @@ -1036,6 +1038,24 @@ bool Entity::makeStepSound() void Entity::checkFallDamage(double ya, bool onGround) { + if (m_clearFallDamageThisTick) + { + m_clearFallDamageThisTick = false; + fallDistance = 0; + return; + } + if (m_ignoreFallDamageUntilGround) + { + if (ya < 0) + { + m_ignoreFallDamageUntilGround = false; + fallDistance = 0; + } + else + { + return; + } + } if (onGround) { if (fallDistance > 0) @@ -1068,6 +1088,13 @@ bool Entity::isFireImmune() return fireImmune; } +void Entity::clearFallDamageQueue() +{ + fallDistance = 0.0f; + m_clearFallDamageThisTick = true; + m_ignoreFallDamageUntilGround = true; +} + void Entity::causeFallDamage(float distance) { if (rider.lock() != nullptr) rider.lock()->causeFallDamage(distance); diff --git a/Minecraft.World/Entity.h b/Minecraft.World/Entity.h index 4fe0fb44..93b68713 100644 --- a/Minecraft.World/Entity.h +++ b/Minecraft.World/Entity.h @@ -170,6 +170,8 @@ private: protected: // 4J Added so that client side simulations on the host are not affected by zero-lag bool m_ignoreVerticalCollisions; + bool m_clearFallDamageThisTick; + bool m_ignoreFallDamageUntilGround; bool m_ignorePortal; @@ -253,6 +255,7 @@ protected: public: bool isFireImmune(); + void clearFallDamageQueue(); protected: virtual void causeFallDamage(float distance); diff --git a/Minecraft.World/LivingEntity.cpp b/Minecraft.World/LivingEntity.cpp index 044f6b7f..8dbfa494 100644 --- a/Minecraft.World/LivingEntity.cpp +++ b/Minecraft.World/LivingEntity.cpp @@ -164,7 +164,7 @@ void LivingEntity::checkFallDamage(double ya, bool onGround) updateInWaterState(); } - if (onGround && fallDistance > 0) + if (onGround) { int xt = Mth::floor(x); int yt = Mth::floor(y - 0.2f - heightOffset); @@ -182,8 +182,11 @@ void LivingEntity::checkFallDamage(double ya, bool onGround) Tile *tile = Tile::tiles[t]; if (t > 0 && tile != nullptr) // tu31 tutorial world fix { - auto ent = shared_from_this(); - Tile::tiles[t]->fallOn(level, xt, yt, zt, ent, fallDistance); + if (fallDistance > 0 || t == Tile::slimeBlock->id) + { + auto ent = shared_from_this(); + Tile::tiles[t]->fallOn(level, xt, yt, zt, ent, fallDistance); + } } } diff --git a/Minecraft.World/SlimeTile.cpp b/Minecraft.World/SlimeTile.cpp index 3dc45b0b..400fc730 100644 --- a/Minecraft.World/SlimeTile.cpp +++ b/Minecraft.World/SlimeTile.cpp @@ -45,6 +45,11 @@ void SlimeTile::fallOn(Level *level, int x, int y, int z, if (entity == nullptr) return; + entity->clearFallDamageQueue(); + + entity->fallDistance = 0.0f; + entity->onGround = false; + if (entity->isSneaking()) return; @@ -60,13 +65,15 @@ void SlimeTile::fallOn(Level *level, int x, int y, int z, entity->yd *= 0.8f; } } - - entity->fallDistance = 0.0f; - entity->onGround = false; } void SlimeTile::stepOn(Level *level, int x, int y, int z, shared_ptr entity) { + if (entity != nullptr) + { + entity->clearFallDamageQueue(); + } + if (entity != nullptr && std::abs(entity->yd) < 0.1f && !entity->isSneaking())