1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 07:53:53 +00:00

Some more missing isInCell checks

This commit is contained in:
scrawl 2014-05-25 15:06:53 +02:00
parent f3ba31de2d
commit 10d835a55c

View file

@ -142,6 +142,11 @@ namespace MWScript
virtual void execute (Interpreter::Runtime& runtime)
{
if (!MWBase::Environment::get().getWorld()->getPlayerPtr().isInCell())
{
runtime.push(0.f);
return;
}
MWWorld::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell();
if (cell->getCell()->hasWater())
runtime.push (cell->getWaterLevel());
@ -158,6 +163,11 @@ namespace MWScript
{
Interpreter::Type_Float level = runtime[0].mFloat;
if (!MWBase::Environment::get().getWorld()->getPlayerPtr().isInCell())
{
return;
}
MWWorld::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell();
if (cell->getCell()->isExterior())
@ -176,6 +186,11 @@ namespace MWScript
{
Interpreter::Type_Float level = runtime[0].mFloat;
if (!MWBase::Environment::get().getWorld()->getPlayerPtr().isInCell())
{
return;
}
MWWorld::CellStore *cell = MWBase::Environment::get().getWorld()->getPlayerPtr().getCell();
if (cell->getCell()->isExterior())