mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 11:39:44 +00:00
Merge branch 'infinite_splash' into 'master'
Fail on invalid water levels Closes #6051 See merge request OpenMW/openmw!1034
This commit is contained in:
commit
59c7e9f7c4
2 changed files with 14 additions and 1 deletions
|
@ -12,6 +12,7 @@
|
|||
Bug #5483: AutoCalc flag is not used to calculate spells cost
|
||||
Bug #5842: GetDisposition adds temporary disposition change from different actors
|
||||
Bug #6037: Morrowind Content Language Cannot be Set to English in OpenMW Launcher
|
||||
Bug #6051: NaN water height in ESM file is not handled gracefully
|
||||
Bug #6066: addtopic "return" does not work from within script. No errors thrown
|
||||
Bug #6067: esp loader fails in for certain subrecord orders
|
||||
Bug #6101: Disarming trapped unlocked owned objects isn't considered a crime
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
#include "loadcell.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <limits>
|
||||
#include <list>
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
#include <components/misc/stringops.hpp>
|
||||
|
||||
#include "esmreader.hpp"
|
||||
|
@ -109,6 +111,7 @@ namespace ESM
|
|||
|
||||
void Cell::loadCell(ESMReader &esm, bool saveContext)
|
||||
{
|
||||
bool overriding = !mName.empty();
|
||||
bool isLoaded = false;
|
||||
mHasAmbi = false;
|
||||
while (!isLoaded && esm.hasMoreSubs())
|
||||
|
@ -123,8 +126,17 @@ namespace ESM
|
|||
mWaterInt = true;
|
||||
break;
|
||||
case ESM::FourCC<'W','H','G','T'>::value:
|
||||
esm.getHT(mWater);
|
||||
float waterLevel;
|
||||
esm.getHT(waterLevel);
|
||||
mWaterInt = false;
|
||||
if(!std::isfinite(waterLevel))
|
||||
{
|
||||
if(!overriding)
|
||||
mWater = std::numeric_limits<float>::max();
|
||||
Log(Debug::Warning) << "Warning: Encountered invalid water level in cell " << mName << " defined in " << esm.getContext().filename;
|
||||
}
|
||||
else
|
||||
mWater = waterLevel;
|
||||
break;
|
||||
case ESM::FourCC<'A','M','B','I'>::value:
|
||||
esm.getHT(mAmbi);
|
||||
|
|
Loading…
Reference in a new issue