mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-13 12:40:04 +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
@ -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…
x
Reference in New Issue
Block a user