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:
parent
f3ba31de2d
commit
10d835a55c
1 changed files with 15 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue