Raise a warning when entering non-existent region

switch-to-ppa
Kindi 2 years ago committed by Evil Eye
parent e2c896e4ce
commit 47ff6a87a3

@ -77,6 +77,7 @@
Bug #6343: Magic projectile speed doesn't take race weight into account
Bug #6347: PlaceItem/PlaceItemCell/PlaceAt should work with levelled creatures
Bug #6354: SFX abruptly cut off after crossing max distance; implement soft fading of sound effects
Bug #6358: Changeweather command does not report an error when entering non-existent region
Bug #6363: Some scripts in Morrowland fail to work
Bug #6376: Creatures should be able to use torches
Bug #6386: Artifacts in water reflection due to imprecise screen-space coordinate computation

@ -11,6 +11,8 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/esmstore.hpp"
#include "interpretercontext.hpp"
namespace MWScript
@ -91,7 +93,11 @@ namespace MWScript
Interpreter::Type_Integer id = runtime[0].mInteger;
runtime.pop();
MWBase::Environment::get().getWorld()->changeWeather(region, id);
const ESM::Region* reg = MWBase::Environment::get().getWorld()->getStore().get<ESM::Region>().search(region);
if (reg)
MWBase::Environment::get().getWorld()->changeWeather(region, id);
else
runtime.getContext().report("Warning: Region \"" + region + "\" was not found");
}
};

Loading…
Cancel
Save