From da4a72ab1987719b26b0aea41b2b21cd1c8fff0c Mon Sep 17 00:00:00 2001 From: Kindi <2538602-Kuyondo@users.noreply.gitlab.com> Date: Fri, 19 Aug 2022 14:51:52 +0000 Subject: [PATCH] Sun Damage for QuasiExt --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/spelleffects.cpp | 2 +- apps/openmw/mwworld/cellstore.cpp | 5 +++++ apps/openmw/mwworld/cellstore.hpp | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b99f77cae..b7c10e1a74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Bug #5129: Stuttering animation on Centurion Archer Bug #5977: Fatigueless NPCs' corpse underwater changes animation on game load Bug #6939: OpenMW-CS: ID columns are too short + Bug #6949: Sun Damage effect doesn't work in quasi exteriors Feature #6945: Support S3TC-compressed and BGR/BGRA NiPixelData 0.48.0 diff --git a/apps/openmw/mwmechanics/spelleffects.cpp b/apps/openmw/mwmechanics/spelleffects.cpp index 81a3dc0921..f491b785f6 100644 --- a/apps/openmw/mwmechanics/spelleffects.cpp +++ b/apps/openmw/mwmechanics/spelleffects.cpp @@ -645,7 +645,7 @@ void applyMagicEffect(const MWWorld::Ptr& target, const MWWorld::Ptr& caster, co case ESM::MagicEffect::SunDamage: { // isInCell shouldn't be needed, but updateActor called during game start - if (!target.isInCell() || !target.getCell()->isExterior() || godmode) + if (!target.isInCell() || !(target.getCell()->isExterior() || target.getCell()->isQuasiExterior()) || godmode) break; float time = world->getTimeStamp().getHour(); float timeDiff = std::clamp(std::abs(time - 13.f), 0.f, 7.f); diff --git a/apps/openmw/mwworld/cellstore.cpp b/apps/openmw/mwworld/cellstore.cpp index 7b9dd57d09..aedf9c6c90 100644 --- a/apps/openmw/mwworld/cellstore.cpp +++ b/apps/openmw/mwworld/cellstore.cpp @@ -671,6 +671,11 @@ namespace MWWorld return mCell->isExterior(); } + bool CellStore::isQuasiExterior() const + { + return (mCell->mData.mFlags & ESM::Cell::QuasiEx) != 0; + } + Ptr CellStore::searchInContainer (const std::string& id) { bool oldState = mHasState; diff --git a/apps/openmw/mwworld/cellstore.hpp b/apps/openmw/mwworld/cellstore.hpp index 091deaf2c5..5132ef4207 100644 --- a/apps/openmw/mwworld/cellstore.hpp +++ b/apps/openmw/mwworld/cellstore.hpp @@ -370,6 +370,8 @@ namespace MWWorld bool isExterior() const; + bool isQuasiExterior() const; + Ptr searchInContainer (const std::string& id); void loadState (const ESM::CellState& state);