[Bug Fix] Swim Skillup and Underwater Fall Damage Fix (#3885)

* [Bug Fix] Swim Skillup and Underwater Fall Damage Fix

No fall damage underwater, need to move to skill up swimming

* Requested Changes
This commit is contained in:
Fryguy 2024-01-07 12:34:25 -05:00 committed by GitHub
parent e52e4d5b3f
commit 51dc62dfb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5062,7 +5062,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
}
if (zone->watermap) {
if (zone->watermap->InLiquid(glm::vec3(m_Position))) {
if (zone->watermap->InLiquid(glm::vec3(m_Position)) && IsMoving()) {
CheckIncreaseSkill(EQ::skills::SkillSwimming, nullptr, -17);
// Dismount horses when entering water
@ -6242,6 +6242,13 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app)
}
if (ed->dmgtype == EQ::constants::EnvironmentalDamage::Falling) {
if (zone->HasWaterMap()) {
auto target_position = glm::vec3(GetX(), GetY(), GetZ());
if (!zone->watermap->InLiquid(target_position)) {
return;
}
}
uint32 mod = spellbonuses.ReduceFallDamage + itembonuses.ReduceFallDamage + aabonuses.ReduceFallDamage;
damage -= damage * mod / 100;
}