1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

throw exception if water level is attempted to be modified in exterior

This commit is contained in:
scrawl 2012-03-29 16:23:02 +02:00
parent 5a19d4ec45
commit 2f096e131d

View file

@ -159,6 +159,10 @@ namespace MWScript
Interpreter::Type_Float level = runtime[0].mFloat;
MWWorld::Ptr::CellStore *cell = context.getWorld().getPlayer().getPlayer().getCell();
if (!(cell->cell->data.flags & ESM::Cell::Interior))
throw std::runtime_error("Can't set water level in exterior cell");
cell->mWaterLevel = level;
context.getEnvironment().mWorld->setWaterHeight(cell->mWaterLevel);
}
@ -176,6 +180,10 @@ namespace MWScript
Interpreter::Type_Float level = runtime[0].mFloat;
MWWorld::Ptr::CellStore *cell = context.getWorld().getPlayer().getPlayer().getCell();
if (!(cell->cell->data.flags & ESM::Cell::Interior))
throw std::runtime_error("Can't set water level in exterior cell");
cell->mWaterLevel +=level;
context.getEnvironment().mWorld->setWaterHeight(cell->mWaterLevel);
}