From 273a2ae3235d554ed30605efb2533cb10c461e89 Mon Sep 17 00:00:00 2001 From: James-Deciutiis Date: Thu, 26 Jan 2023 14:37:27 -0800 Subject: [PATCH] teleporting to an underwater marked location will remove water walking spell effects from actor fix formatting addressing hasWaterWalking comment refactor to address remaining comments clean up formatter changes adding suggested condition to if statement move isWaterWalking check into if statement refactor if block to see if actor needs to have water walking purged added entry to changelog.md and authors.md removing redundant check from if statement Sort previous changelog entry --- AUTHORS.md | 1 + CHANGELOG.md | 1 + apps/openmw/mwworld/actionteleport.cpp | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/AUTHORS.md b/AUTHORS.md index 0939409926..23f9fe94ea 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -101,6 +101,7 @@ Programmers Jacob Turnbull (Tankinfrank) Jake Westrip (16bitint) James Carty (MrTopCat) + James Deciutiis (JamesDeciutiis) James Moore (moore.work) James Stephens (james-h-stephens) Jan-Peter Nilsson (peppe) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca1251cae1..cbd039f101 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ Bug #7054: Quests aren't sorted by name Bug #7084: Resurrecting an actor doesn't take into account base record changes Bug #7088: Deleting last save game of last character doesn't clear character name/details + Bug #7122: Teleportation to underwater should cancel active water walking effect Bug #7172: Current music playlist continues playing indefinitely if next playlist is empty Feature #5492: Let rain and snow collide with statics Feature #6447: Add LOD support to Object Paging diff --git a/apps/openmw/mwworld/actionteleport.cpp b/apps/openmw/mwworld/actionteleport.cpp index 195eaff43d..b86e7440a3 100644 --- a/apps/openmw/mwworld/actionteleport.cpp +++ b/apps/openmw/mwworld/actionteleport.cpp @@ -1,11 +1,13 @@ #include "actionteleport.hpp" #include +#include #include "../mwbase/environment.hpp" #include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/world.hpp" +#include "../mwmechanics/actorutil.hpp" #include "../mwmechanics/creaturestats.hpp" #include "../mwworld/cellstore.hpp" @@ -45,6 +47,7 @@ namespace MWWorld MWBase::World* world = MWBase::Environment::get().getWorld(); MWWorld::WorldModel* worldModel = MWBase::Environment::get().getWorldModel(); actor.getClass().getCreatureStats(actor).land(actor == world->getPlayerPtr()); + if (actor == world->getPlayerPtr()) { world->getPlayer().setTeleported(true); @@ -65,6 +68,10 @@ namespace MWWorld else world->moveObject(actor, worldModel->getInterior(mCellName), mPosition.asVec3(), true, true); } + + if (!world->isWaterWalkingCastableOnTarget(actor) && MWMechanics::hasWaterWalking(actor)) + actor.getClass().getCreatureStats(actor).getActiveSpells().purgeEffect( + actor, ESM::MagicEffect::WaterWalking); } void ActionTeleport::getFollowers(