mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 04:45:34 +00:00
GetWaterLevel fix (similar to MCP): if there is no water in the cell, return -FLT_MAX to prevent mods from incorrectly thinking the player is underwater.
This commit is contained in:
parent
bf02b77c1d
commit
c55f9bd0aa
1 changed files with 4 additions and 1 deletions
|
@ -130,7 +130,10 @@ namespace MWScript
|
||||||
virtual void execute (Interpreter::Runtime& runtime)
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
{
|
{
|
||||||
MWWorld::Ptr::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell();
|
MWWorld::Ptr::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell();
|
||||||
|
if (cell->mCell->hasWater())
|
||||||
runtime.push (cell->mWaterLevel);
|
runtime.push (cell->mWaterLevel);
|
||||||
|
else
|
||||||
|
runtime.push (-std::numeric_limits<float>().max());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue