mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-14 23:05:57 -04:00
Don't enable water collision when collision is disabled (#8414)
This commit is contained in:
parent
d13f108779
commit
652113c46d
@ -656,20 +656,18 @@ namespace MWPhysics
|
|||||||
auto ptr = physicActor->getPtr();
|
auto ptr = physicActor->getPtr();
|
||||||
if (!ptr.getClass().isMobile(ptr))
|
if (!ptr.getClass().isMobile(ptr))
|
||||||
continue;
|
continue;
|
||||||
float waterlevel = -std::numeric_limits<float>::max();
|
|
||||||
const MWWorld::CellStore* cell = ptr.getCell();
|
|
||||||
if (cell->getCell()->hasWater())
|
|
||||||
waterlevel = cell->getWaterLevel();
|
|
||||||
|
|
||||||
|
const MWWorld::CellStore& cell = *ptr.getCell();
|
||||||
const auto& stats = ptr.getClass().getCreatureStats(ptr);
|
const auto& stats = ptr.getClass().getCreatureStats(ptr);
|
||||||
const MWMechanics::MagicEffects& effects = stats.getMagicEffects();
|
const MWMechanics::MagicEffects& effects = stats.getMagicEffects();
|
||||||
|
|
||||||
|
float waterlevel = -std::numeric_limits<float>::max();
|
||||||
bool waterCollision = false;
|
bool waterCollision = false;
|
||||||
if (cell->getCell()->hasWater() && effects.getOrDefault(ESM::MagicEffect::WaterWalking).getMagnitude())
|
if (cell.getCell()->hasWater())
|
||||||
{
|
{
|
||||||
if (physicActor->getCollisionMode()
|
waterlevel = cell.getWaterLevel();
|
||||||
|| !world->isUnderwater(ptr.getCell(), ptr.getRefData().getPosition().asVec3()))
|
if (physicActor->getCollisionMode())
|
||||||
waterCollision = true;
|
waterCollision = effects.getOrDefault(ESM::MagicEffect::WaterWalking).getMagnitude();
|
||||||
}
|
}
|
||||||
|
|
||||||
physicActor->setCanWaterWalk(waterCollision);
|
physicActor->setCanWaterWalk(waterCollision);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user