diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index b0486b40a2..bc7c504471 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -16,13 +16,13 @@ #include "../mwworld/globalvariablename.hpp" #include "../mwworld/ptr.hpp" #include "../mwworld/spellcaststate.hpp" -#include "../mwworld/weather.hpp" #include "../mwrender/rendermode.hpp" namespace osg { class Vec3f; + class Vec4f; class Matrixf; class Quat; class Image; @@ -94,6 +94,7 @@ namespace MWWorld class RefData; class Cell; class DateTimeManager; + class Weather; typedef std::vector> PtrMovementList; } diff --git a/apps/openmw/mwdialogue/filter.cpp b/apps/openmw/mwdialogue/filter.cpp index 4a46b9be60..92ec453c58 100644 --- a/apps/openmw/mwdialogue/filter.cpp +++ b/apps/openmw/mwdialogue/filter.cpp @@ -18,6 +18,7 @@ #include "../mwworld/class.hpp" #include "../mwworld/esmstore.hpp" #include "../mwworld/inventorystore.hpp" +#include "../mwworld/weather.hpp" #include "../mwmechanics/actorutil.hpp" #include "../mwmechanics/creaturestats.hpp" diff --git a/apps/openmw/mwlua/weatherbindings.cpp b/apps/openmw/mwlua/weatherbindings.cpp index e2a75a2c0b..d67851c3c6 100644 --- a/apps/openmw/mwlua/weatherbindings.cpp +++ b/apps/openmw/mwlua/weatherbindings.cpp @@ -8,6 +8,8 @@ #include "../mwworld/esmstore.hpp" #include "../mwworld/weather.hpp" +#include "context.hpp" + namespace { class WeatherStore @@ -123,11 +125,8 @@ namespace MWLua api["changeWeather"] = [](std::string_view regionId, const MWWorld::Weather& weather) { ESM::RefId region = ESM::RefId::deserializeText(regionId); - const ESM::Region* reg = MWBase::Environment::get().getESMStore()->get().search(region); - if (reg) - MWBase::Environment::get().getWorld()->changeWeather(region, weather.mId); - else - throw std::runtime_error("Region not found"); + MWBase::Environment::get().getESMStore()->get().find(region); + MWBase::Environment::get().getWorld()->changeWeather(region, weather.mId); }; sol::usertype storeT = lua.new_usertype("WeatherWorldStore"); diff --git a/apps/openmw/mwlua/weatherbindings.hpp b/apps/openmw/mwlua/weatherbindings.hpp index 4f4809354c..c4686602ff 100644 --- a/apps/openmw/mwlua/weatherbindings.hpp +++ b/apps/openmw/mwlua/weatherbindings.hpp @@ -3,10 +3,9 @@ #include -#include "context.hpp" - namespace MWLua { + struct Context; sol::table initCoreWeatherBindings(const Context&); diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index ed3f0e513e..82cc9b8b3c 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -60,6 +60,7 @@ #include "../mwworld/class.hpp" #include "../mwworld/groundcoverstore.hpp" #include "../mwworld/scene.hpp" +#include "../mwworld/weather.hpp" #include "../mwgui/postprocessorhud.hpp" diff --git a/apps/openmw/mwscript/skyextensions.cpp b/apps/openmw/mwscript/skyextensions.cpp index 462f7bd811..e85d8381ba 100644 --- a/apps/openmw/mwscript/skyextensions.cpp +++ b/apps/openmw/mwscript/skyextensions.cpp @@ -14,6 +14,7 @@ #include "../mwbase/world.hpp" #include "../mwworld/esmstore.hpp" +#include "../mwworld/weather.hpp" namespace MWScript {