Do not use a rendering node position as a hit position (bug 7298)

depth-refraction
Andrei Kortunov 1 year ago
parent 1a1f983930
commit 74126953fc

@ -50,6 +50,7 @@
Bug #7172: Current music playlist continues playing indefinitely if next playlist is empty
Bug #7229: Error marker loading failure is not handled
Bug #7243: Get Skyrim.esm loading
Bug #7298: Water ripples from projectiles sometimes are not spawned
Feature #5492: Let rain and snow collide with statics
Feature #6447: Add LOD support to Object Paging
Feature #6726: Lua API for creating new objects

@ -16,6 +16,7 @@
#include <components/esm3/projectilestate.hpp>
#include <components/misc/constants.hpp>
#include <components/misc/convert.hpp>
#include <components/misc/resourcehelpers.hpp>
#include <components/resource/resourcesystem.hpp>
@ -546,11 +547,14 @@ namespace MWWorld
if (invIt != inv.end() && invIt->getCellRef().getRefId() == projectileState.mBowId)
bow = *invIt;
}
const auto hitPosition = Misc::Convert::toOsg(projectile->getHitPosition());
if (projectile->getHitWater())
mRendering->emitWaterRipple(pos);
mRendering->emitWaterRipple(hitPosition);
MWMechanics::projectileHit(
caster, target, bow, projectileRef.getPtr(), pos, projectileState.mAttackStrength);
caster, target, bow, projectileRef.getPtr(), hitPosition, projectileState.mAttackStrength);
projectileState.mToDelete = true;
}
const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore();
@ -574,7 +578,7 @@ namespace MWWorld
assert(target != caster);
MWMechanics::CastSpell cast(caster, target);
cast.mHitPosition = pos;
cast.mHitPosition = Misc::Convert::toOsg(projectile->getHitPosition());
cast.mId = magicBoltState.mSpellId;
cast.mSourceName = magicBoltState.mSourceName;
cast.mSlot = magicBoltState.mSlot;

Loading…
Cancel
Save