mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 12:58:00 +03:00
Merge branch 'waterwalkingtcl' into 'master'
Some checks failed
Build and test / Ubuntu (push) Has been cancelled
Build and test / MacOS (push) Has been cancelled
Build and test / Read .env file and expose it as output (push) Has been cancelled
Build and test / Windows (2019) (push) Has been cancelled
Build and test / Windows (2022) (push) Has been cancelled
Some checks failed
Build and test / Ubuntu (push) Has been cancelled
Build and test / MacOS (push) Has been cancelled
Build and test / Read .env file and expose it as output (push) Has been cancelled
Build and test / Windows (2019) (push) Has been cancelled
Build and test / Windows (2022) (push) Has been cancelled
Don't enable water collision when collision is disabled (#8414) Closes #8414 See merge request OpenMW/openmw!4600
This commit is contained in:
commit
cb20a3f8e4
1 changed files with 6 additions and 8 deletions
|
@ -656,20 +656,18 @@ namespace MWPhysics
|
|||
auto ptr = physicActor->getPtr();
|
||||
if (!ptr.getClass().isMobile(ptr))
|
||||
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 MWMechanics::MagicEffects& effects = stats.getMagicEffects();
|
||||
|
||||
float waterlevel = -std::numeric_limits<float>::max();
|
||||
bool waterCollision = false;
|
||||
if (cell->getCell()->hasWater() && effects.getOrDefault(ESM::MagicEffect::WaterWalking).getMagnitude())
|
||||
if (cell.getCell()->hasWater())
|
||||
{
|
||||
if (physicActor->getCollisionMode()
|
||||
|| !world->isUnderwater(ptr.getCell(), ptr.getRefData().getPosition().asVec3()))
|
||||
waterCollision = true;
|
||||
waterlevel = cell.getWaterLevel();
|
||||
if (physicActor->getCollisionMode())
|
||||
waterCollision = effects.getOrDefault(ESM::MagicEffect::WaterWalking).getMagnitude();
|
||||
}
|
||||
|
||||
physicActor->setCanWaterWalk(waterCollision);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue