mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-31 22:45:33 +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)
|
||||
{
|
||||
MWWorld::Ptr::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell();
|
||||
runtime.push (cell->mWaterLevel);
|
||||
if (cell->mCell->hasWater())
|
||||
runtime.push (cell->mWaterLevel);
|
||||
else
|
||||
runtime.push (-std::numeric_limits<float>().max());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue