1
0
Fork 1
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:
scrawl 2014-01-08 20:19:47 +01:00
parent bf02b77c1d
commit c55f9bd0aa

View file

@ -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());
}
};