diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fedc707bd7..cdda455dac 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -108,8 +108,8 @@ Coverity:
- ccache/
variables:
CCACHE_SIZE: 2G
- CC: clang-12
- CXX: clang++-12
+ CC: clang
+ CXX: clang++
CMAKE_BUILD_TYPE: Debug
CMAKE_CXX_FLAGS_DEBUG: -O0
before_script:
@@ -125,18 +125,34 @@ Coverity:
- ccache -z -M "${CCACHE_SIZE}"
- CI/before_script.linux.sh
- cov-analysis-linux64-*/bin/cov-configure --template --comptype prefix --compiler ccache
- # Remove the specific targets and build everything once we can do it under 3h
- cov-analysis-linux64-*/bin/cov-build --dir cov-int cmake --build build -- -j $(nproc)
- ccache -svv
- after_script:
- tar cfz cov-int.tar.gz cov-int
- - curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
- --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
- --form file=@cov-int.tar.gz --form version="$CI_COMMIT_REF_NAME:$CI_COMMIT_SHORT_SHA"
- --form description="CI_COMMIT_SHORT_SHA / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
+ - echo "OPENMW_JOB_ID=$CI_JOB_ID" >> build.env
artifacts:
+ expire_in: 1 day
paths:
- /builds/OpenMW/openmw/cov-int/build-log.txt
+ - /builds/OpenMW/openmw/cov-int.tar.gz
+ reports:
+ dotenv: build.env
+
+Coverity_Upload:
+ image: ubuntu:24.04
+ stage: build
+ rules:
+ - if: $CI_PIPELINE_SOURCE == "schedule"
+ before_script:
+ - CI/install_debian_deps.sh coverity_upload
+ script:
+ - echo "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/$OPENMW_JOB_ID/artifacts/cov-int.tar.gz"
+ - curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
+ --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
+ --form version="$CI_COMMIT_REF_NAME:$CI_COMMIT_SHORT_SHA"
+ --form description="CI_COMMIT_SHORT_SHA / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
+ --form url="$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/$OPENMW_JOB_ID/artifacts/cov-int.tar.gz"
+ needs:
+ - Coverity
Ubuntu_GCC:
extends: .Ubuntu
diff --git a/CI/install_debian_deps.sh b/CI/install_debian_deps.sh
index 4f0e7cdb69..aada722fb1 100755
--- a/CI/install_debian_deps.sh
+++ b/CI/install_debian_deps.sh
@@ -11,7 +11,8 @@ print_help() {
declare -rA GROUPED_DEPS=(
[gcc]="binutils gcc build-essential cmake ccache curl unzip git pkg-config mold"
[clang]="binutils clang make cmake ccache curl unzip git pkg-config mold"
- [coverity]="binutils clang-12 make cmake ccache curl unzip git pkg-config"
+ [coverity]="binutils clang make cmake ccache curl unzip git pkg-config file"
+ [coverity_upload]="curl"
[gcc_preprocess]="
binutils
build-essential
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b4ef872eb6..57ebeefcfd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,7 +82,7 @@ message(STATUS "Configuring OpenMW...")
set(OPENMW_VERSION_MAJOR 0)
set(OPENMW_VERSION_MINOR 50)
set(OPENMW_VERSION_RELEASE 0)
-set(OPENMW_LUA_API_REVISION 86)
+set(OPENMW_LUA_API_REVISION 87)
set(OPENMW_POSTPROCESSING_API_REVISION 3)
set(OPENMW_VERSION_COMMITHASH "")
diff --git a/apps/launcher/settingspage.cpp b/apps/launcher/settingspage.cpp
index 27fa2ca27c..849f13076d 100644
--- a/apps/launcher/settingspage.cpp
+++ b/apps/launcher/settingspage.cpp
@@ -291,6 +291,7 @@ bool Launcher::SettingsPage::loadSettings()
}
}
loadSettingBool(Settings::sound().mCameraListener, *cameraListenerCheckBox);
+ dopplerSpinBox->setValue(Settings::sound().mDopplerFactor);
}
// Interface Changes
@@ -482,6 +483,8 @@ void Launcher::SettingsPage::saveSettings()
const bool cCameraListener = cameraListenerCheckBox->checkState() != Qt::Unchecked;
Settings::sound().mCameraListener.set(cCameraListener);
+
+ Settings::sound().mDopplerFactor.set(dopplerSpinBox->value());
}
// Interface Changes
diff --git a/apps/launcher/ui/settingspage.ui b/apps/launcher/ui/settingspage.ui
index b96d734605..d7e1a4b3ab 100644
--- a/apps/launcher/ui/settingspage.ui
+++ b/apps/launcher/ui/settingspage.ui
@@ -1224,6 +1224,51 @@
+ -
+
+
-
+
+
+ <html><head/><body><p>Controls the strength of the Doppler effect. Zero means it is completely disabled.</p><p>The Doppler effect increases or decreases the pitch of sounds relative to the velocity of the sound source and the listener.</p></body></html>
+
+
+ Doppler Factor
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 283
+ 0
+
+
+
+ 2
+
+
+ 0.000000000000000
+
+
+ 1.000000000000000
+
+
+ 0.010000000000000
+
+
+ 0.250000000000000
+
+
+
+
+
-
diff --git a/apps/opencs/model/world/idcollection.cpp b/apps/opencs/model/world/idcollection.cpp
index ca56eceb69..7890dc47b8 100644
--- a/apps/opencs/model/world/idcollection.cpp
+++ b/apps/opencs/model/world/idcollection.cpp
@@ -59,14 +59,13 @@ namespace CSMWorld
const Record* IdCollection::searchRecord(std::uint16_t index, int plugin) const
{
- auto found = mIndices.find({ plugin, index });
- if (found != mIndices.end())
- {
- int index = searchId(found->second);
- if (index != -1)
- return &getRecord(index);
- }
- return nullptr;
+ const auto it = mIndices.find({ plugin, index });
+ if (it == mIndices.end())
+ return nullptr;
+ const int recordIndex = searchId(it->second);
+ if (recordIndex == -1)
+ return nullptr;
+ return &getRecord(recordIndex);
}
const std::string* IdCollection::getLandTexture(std::uint16_t index, int plugin) const
diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp
index 0ea8451774..2a66878a04 100644
--- a/apps/openmw/engine.cpp
+++ b/apps/openmw/engine.cpp
@@ -5,7 +5,8 @@
#include
#include
-#include
+#include
+#include
#include
#include
@@ -28,7 +29,6 @@
#include
-#include
#include
#include
diff --git a/apps/openmw/mwbase/luamanager.hpp b/apps/openmw/mwbase/luamanager.hpp
index 61574de3ac..5772c555a3 100644
--- a/apps/openmw/mwbase/luamanager.hpp
+++ b/apps/openmw/mwbase/luamanager.hpp
@@ -75,6 +75,7 @@ namespace MWBase
const MWRender::AnimPriority& priority, int blendMask, bool autodisable, float speedmult,
std::string_view start, std::string_view stop, float startpoint, uint32_t loops, bool loopfallback)
= 0;
+ virtual void jailTimeServed(const MWWorld::Ptr& actor, int days) = 0;
virtual void skillLevelUp(const MWWorld::Ptr& actor, ESM::RefId skillId, std::string_view source) = 0;
virtual void skillUse(const MWWorld::Ptr& actor, ESM::RefId skillId, int useType, float scale) = 0;
virtual void onHit(const MWWorld::Ptr& attacker, const MWWorld::Ptr& victim, const MWWorld::Ptr& weapon,
diff --git a/apps/openmw/mwbase/soundmanager.hpp b/apps/openmw/mwbase/soundmanager.hpp
index 532bc771ba..5591b7205c 100644
--- a/apps/openmw/mwbase/soundmanager.hpp
+++ b/apps/openmw/mwbase/soundmanager.hpp
@@ -234,6 +234,8 @@ namespace MWBase
const osg::Vec3f& pos, const osg::Vec3f& dir, const osg::Vec3f& up, bool underwater)
= 0;
+ virtual void setListenerVel(const osg::Vec3f& vel) = 0;
+
virtual void updatePtr(const MWWorld::ConstPtr& old, const MWWorld::ConstPtr& updated) = 0;
void setSimulationTimeScale(float scale) { mSimulationTimeScale = scale; }
diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp
index 157c12af23..74bd9f6a5c 100644
--- a/apps/openmw/mwbase/world.hpp
+++ b/apps/openmw/mwbase/world.hpp
@@ -496,6 +496,8 @@ namespace MWBase
virtual float getSunVisibility() const = 0;
virtual float getSunPercentage() const = 0;
+ virtual float getPhysicsFrameRateDt() const = 0;
+
virtual bool findInteriorPositionInWorldSpace(const MWWorld::CellStore* cell, osg::Vec3f& result) = 0;
/// Teleports \a ptr to the closest reference of \a id (e.g. DivineMarker, PrisonMarker, TempleMarker)
diff --git a/apps/openmw/mwgui/jailscreen.cpp b/apps/openmw/mwgui/jailscreen.cpp
index 2fbaa8d8ac..9244e9dd2f 100644
--- a/apps/openmw/mwgui/jailscreen.cpp
+++ b/apps/openmw/mwgui/jailscreen.cpp
@@ -4,6 +4,7 @@
#include
#include "../mwbase/environment.hpp"
+#include "../mwbase/luamanager.hpp"
#include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/world.hpp"
@@ -86,46 +87,6 @@ namespace MWGui
// We should not worsen corprus when in prison
player.getClass().getCreatureStats(player).getActiveSpells().skipWorsenings(mDays * 24);
-
- const auto& skillStore = MWBase::Environment::get().getESMStore()->get();
- std::set skills;
- for (int day = 0; day < mDays; ++day)
- {
- auto& prng = MWBase::Environment::get().getWorld()->getPrng();
- const ESM::Skill* skill = skillStore.searchRandom({}, prng);
- skills.insert(skill);
-
- MWMechanics::SkillValue& value = player.getClass().getNpcStats(player).getSkill(skill->mId);
- if (skill->mId == ESM::Skill::Security || skill->mId == ESM::Skill::Sneak)
- value.setBase(std::min(100.f, value.getBase() + 1));
- else
- value.setBase(std::max(0.f, value.getBase() - 1));
- }
-
- const MWWorld::Store& gmst
- = MWBase::Environment::get().getESMStore()->get();
-
- std::string message;
- if (mDays == 1)
- message = gmst.find("sNotifyMessage42")->mValue.getString();
- else
- message = gmst.find("sNotifyMessage43")->mValue.getString();
-
- message = Misc::StringUtils::format(message, mDays);
-
- for (const ESM::Skill* skill : skills)
- {
- int skillValue = player.getClass().getNpcStats(player).getSkill(skill->mId).getBase();
- std::string skillMsg = gmst.find("sNotifyMessage44")->mValue.getString();
- if (skill->mId == ESM::Skill::Sneak || skill->mId == ESM::Skill::Security)
- skillMsg = gmst.find("sNotifyMessage39")->mValue.getString();
-
- skillMsg = Misc::StringUtils::format(skillMsg, skill->mName, skillValue);
- message += "\n" + skillMsg;
- }
-
- std::vector buttons;
- buttons.emplace_back("#{Interface:OK}");
- MWBase::Environment::get().getWindowManager()->interactiveMessageBox(message, buttons);
+ MWBase::Environment::get().getLuaManager()->jailTimeServed(player, mDays);
}
}
diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp
index 59d21886dc..51a765442a 100644
--- a/apps/openmw/mwgui/mapwindow.cpp
+++ b/apps/openmw/mwgui/mapwindow.cpp
@@ -774,12 +774,10 @@ namespace MWGui
, mGlobalMapRender(std::make_unique(localMapRender->getRoot(), workQueue))
, mEditNoteDialog()
{
- static bool registered = false;
- if (!registered)
- {
+ [[maybe_unused]] static const bool registered = [] {
MyGUI::FactoryManager::getInstance().registerFactory("Widget");
- registered = true;
- }
+ return true;
+ }();
mEditNoteDialog.setVisible(false);
mEditNoteDialog.eventOkClicked += MyGUI::newDelegate(this, &MapWindow::onNoteEditOk);
diff --git a/apps/openmw/mwgui/spellcreationdialog.cpp b/apps/openmw/mwgui/spellcreationdialog.cpp
index d8302df87c..6bd9ef3ac8 100644
--- a/apps/openmw/mwgui/spellcreationdialog.cpp
+++ b/apps/openmw/mwgui/spellcreationdialog.cpp
@@ -352,6 +352,7 @@ namespace MWGui
getWidget(mAvailableEffectsList, "AvailableEffects");
getWidget(mUsedEffectsView, "UsedEffects");
getWidget(mPriceLabel, "PriceLabel");
+ getWidget(mPlayerGold, "PlayerGold");
getWidget(mBuyButton, "BuyButton");
getWidget(mCancelButton, "CancelButton");
@@ -370,6 +371,10 @@ namespace MWGui
mPtr = actor;
mNameEdit->setCaption({});
+ MWWorld::Ptr player = MWMechanics::getPlayer();
+ int playerGold = player.getClass().getContainerStore(player).count(MWWorld::ContainerStore::sGoldId);
+ mPlayerGold->setCaptionWithReplacing(MyGUI::utility::toString(playerGold));
+
startEditing();
}
diff --git a/apps/openmw/mwgui/spellcreationdialog.hpp b/apps/openmw/mwgui/spellcreationdialog.hpp
index 6dfe61fc57..0887dd8c94 100644
--- a/apps/openmw/mwgui/spellcreationdialog.hpp
+++ b/apps/openmw/mwgui/spellcreationdialog.hpp
@@ -175,6 +175,7 @@ namespace MWGui
MyGUI::Button* mBuyButton;
MyGUI::Button* mCancelButton;
MyGUI::TextBox* mPriceLabel;
+ MyGUI::TextBox* mPlayerGold;
ESM::Spell mSpell;
};
diff --git a/apps/openmw/mwgui/trainingwindow.cpp b/apps/openmw/mwgui/trainingwindow.cpp
index 4bde77a552..3fc8412d4c 100644
--- a/apps/openmw/mwgui/trainingwindow.cpp
+++ b/apps/openmw/mwgui/trainingwindow.cpp
@@ -29,7 +29,7 @@ namespace MWGui
: WindowBase("openmw_trainingwindow.layout")
{
getWidget(mTrainingOptions, "TrainingOptions");
- getWidget(mCancelButton, "CancelButton");
+ getWidget(mCancelButton, "OkButton");
getWidget(mPlayerGold, "PlayerGold");
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TrainingWindow::onCancelButtonClicked);
@@ -115,14 +115,14 @@ namespace MWGui
MyGUI::Button* button = mTrainingOptions->createWidget(price <= playerGold
? "SandTextButton"
: "SandTextButtonDisabled", // can't use setEnabled since that removes tooltip
- MyGUI::IntCoord(5, 5 + i * lineHeight, mTrainingOptions->getWidth() - 10, lineHeight),
+ MyGUI::IntCoord(4, 3 + i * lineHeight, mTrainingOptions->getWidth() - 10, lineHeight),
MyGUI::Align::Default);
button->setUserData(skills[i].first);
button->eventMouseButtonClick += MyGUI::newDelegate(this, &TrainingWindow::onTrainingSelected);
button->setCaptionWithReplacing(
- MyGUI::TextIterator::toTagsString(skill->mName) + " - " + MyGUI::utility::toString(price));
+ MyGUI::TextIterator::toTagsString(skill->mName) + " - " + MyGUI::utility::toString(price) + "#{sgp}");
button->setSize(button->getTextSize().width + 12, button->getSize().height);
diff --git a/apps/openmw/mwlua/animationbindings.cpp b/apps/openmw/mwlua/animationbindings.cpp
index 1af7acea36..5ecd3bd1fa 100644
--- a/apps/openmw/mwlua/animationbindings.cpp
+++ b/apps/openmw/mwlua/animationbindings.cpp
@@ -1,13 +1,7 @@
#include "animationbindings.hpp"
-#include
-#include
-#include
#include
-#include
#include
-#include
-#include
#include "../mwbase/environment.hpp"
#include "../mwbase/mechanicsmanager.hpp"
@@ -15,11 +9,8 @@
#include "../mwmechanics/character.hpp"
-#include "../mwworld/esmstore.hpp"
-
#include "context.hpp"
#include "luamanagerimp.hpp"
-#include "objectvariant.hpp"
namespace MWLua
{
diff --git a/apps/openmw/mwlua/birthsignbindings.cpp b/apps/openmw/mwlua/birthsignbindings.cpp
index 218d05b804..130144ab9b 100644
--- a/apps/openmw/mwlua/birthsignbindings.cpp
+++ b/apps/openmw/mwlua/birthsignbindings.cpp
@@ -8,7 +8,7 @@
#include "../mwbase/environment.hpp"
#include "idcollectionbindings.hpp"
-#include "types/types.hpp"
+#include "recordstore.hpp"
namespace sol
{
diff --git a/apps/openmw/mwlua/birthsignbindings.hpp b/apps/openmw/mwlua/birthsignbindings.hpp
index bf41707d47..e57d56c971 100644
--- a/apps/openmw/mwlua/birthsignbindings.hpp
+++ b/apps/openmw/mwlua/birthsignbindings.hpp
@@ -3,10 +3,10 @@
#include
-#include "context.hpp"
-
namespace MWLua
{
+ struct Context;
+
sol::table initBirthSignRecordBindings(const Context& context);
}
diff --git a/apps/openmw/mwlua/cellbindings.cpp b/apps/openmw/mwlua/cellbindings.cpp
index ec64a3cddd..4e4542d89f 100644
--- a/apps/openmw/mwlua/cellbindings.cpp
+++ b/apps/openmw/mwlua/cellbindings.cpp
@@ -1,7 +1,5 @@
#include "cellbindings.hpp"
-#include
-
#include
#include
#include
@@ -27,7 +25,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -38,7 +35,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/apps/openmw/mwlua/cellbindings.hpp b/apps/openmw/mwlua/cellbindings.hpp
index 0d8e90e989..70255d8d7f 100644
--- a/apps/openmw/mwlua/cellbindings.hpp
+++ b/apps/openmw/mwlua/cellbindings.hpp
@@ -1,12 +1,12 @@
#ifndef MWLUA_CELLBINDINGS_H
#define MWLUA_CELLBINDINGS_H
-#include "context.hpp"
-
namespace MWLua
{
- void initCellBindingsForLocalScripts(const Context&);
- void initCellBindingsForGlobalScripts(const Context&);
+ struct Context;
+
+ void initCellBindingsForLocalScripts(const Context& context);
+ void initCellBindingsForGlobalScripts(const Context& context);
}
#endif // MWLUA_CELLBINDINGS_H
diff --git a/apps/openmw/mwlua/classbindings.cpp b/apps/openmw/mwlua/classbindings.cpp
index c94631fb3c..338698bfee 100644
--- a/apps/openmw/mwlua/classbindings.cpp
+++ b/apps/openmw/mwlua/classbindings.cpp
@@ -4,7 +4,7 @@
#include
#include "idcollectionbindings.hpp"
-#include "types/types.hpp"
+#include "recordstore.hpp"
namespace sol
{
diff --git a/apps/openmw/mwlua/classbindings.hpp b/apps/openmw/mwlua/classbindings.hpp
index 1acb0a9ad3..cc67f2df02 100644
--- a/apps/openmw/mwlua/classbindings.hpp
+++ b/apps/openmw/mwlua/classbindings.hpp
@@ -3,10 +3,10 @@
#include
-#include "context.hpp"
-
namespace MWLua
{
+ struct Context;
+
sol::table initClassRecordBindings(const Context& context);
}
diff --git a/apps/openmw/mwlua/corebindings.cpp b/apps/openmw/mwlua/corebindings.cpp
index bdf71710af..282a9f970b 100644
--- a/apps/openmw/mwlua/corebindings.cpp
+++ b/apps/openmw/mwlua/corebindings.cpp
@@ -4,7 +4,6 @@
#include
#include
-#include
#include
#include
#include
@@ -20,6 +19,7 @@
#include "../mwworld/datetimemanager.hpp"
#include "../mwworld/esmstore.hpp"
+#include "context.hpp"
#include "coremwscriptbindings.hpp"
#include "dialoguebindings.hpp"
#include "factionbindings.hpp"
diff --git a/apps/openmw/mwlua/corebindings.hpp b/apps/openmw/mwlua/corebindings.hpp
index ef385ca993..6d27dd0412 100644
--- a/apps/openmw/mwlua/corebindings.hpp
+++ b/apps/openmw/mwlua/corebindings.hpp
@@ -3,13 +3,13 @@
#include
-#include "context.hpp"
-
namespace MWLua
{
+ struct Context;
+
void addCoreTimeBindings(sol::table& api, const Context& context);
- sol::table initCorePackage(const Context&);
+ sol::table initCorePackage(const Context& context);
}
#endif // MWLUA_COREBINDINGS_H
diff --git a/apps/openmw/mwlua/debugbindings.hpp b/apps/openmw/mwlua/debugbindings.hpp
index c508b54496..d7902cb618 100644
--- a/apps/openmw/mwlua/debugbindings.hpp
+++ b/apps/openmw/mwlua/debugbindings.hpp
@@ -1,7 +1,7 @@
#ifndef OPENMW_MWLUA_DEBUGBINDINGS_H
#define OPENMW_MWLUA_DEBUGBINDINGS_H
-#include
+#include
namespace MWLua
{
diff --git a/apps/openmw/mwlua/engineevents.cpp b/apps/openmw/mwlua/engineevents.cpp
index 6c652bccba..be7d249bfc 100644
--- a/apps/openmw/mwlua/engineevents.cpp
+++ b/apps/openmw/mwlua/engineevents.cpp
@@ -113,6 +113,15 @@ namespace MWLua
scripts->onSkillLevelUp(event.mSkill, event.mSource);
}
+ void operator()(const OnJailTimeServed& event) const
+ {
+ MWWorld::Ptr actor = getPtr(event.mActor);
+ if (actor.isEmpty())
+ return;
+ if (auto* scripts = getLocalScripts(actor))
+ scripts->onJailTimeServed(event.mDays);
+ }
+
private:
MWWorld::Ptr getPtr(ESM::RefNum id) const
{
diff --git a/apps/openmw/mwlua/engineevents.hpp b/apps/openmw/mwlua/engineevents.hpp
index fb9183eb7c..407739d60e 100644
--- a/apps/openmw/mwlua/engineevents.hpp
+++ b/apps/openmw/mwlua/engineevents.hpp
@@ -70,8 +70,13 @@ namespace MWLua
std::string mSkill;
std::string mSource;
};
+ struct OnJailTimeServed
+ {
+ ESM::RefNum mActor;
+ int mDays;
+ };
using Event = std::variant;
+ OnAnimationTextKey, OnSkillUse, OnSkillLevelUp, OnJailTimeServed>;
void clear() { mQueue.clear(); }
void addToQueue(Event e) { mQueue.push_back(std::move(e)); }
diff --git a/apps/openmw/mwlua/factionbindings.hpp b/apps/openmw/mwlua/factionbindings.hpp
index 0dc06ceaf2..280c7d4791 100644
--- a/apps/openmw/mwlua/factionbindings.hpp
+++ b/apps/openmw/mwlua/factionbindings.hpp
@@ -3,10 +3,10 @@
#include
-#include "context.hpp"
-
namespace MWLua
{
+ struct Context;
+
sol::table initCoreFactionBindings(const Context& context);
}
diff --git a/apps/openmw/mwlua/inputbindings.cpp b/apps/openmw/mwlua/inputbindings.cpp
index c3b47c5061..9a781106a6 100644
--- a/apps/openmw/mwlua/inputbindings.cpp
+++ b/apps/openmw/mwlua/inputbindings.cpp
@@ -13,6 +13,7 @@
#include "../mwbase/windowmanager.hpp"
#include "../mwinput/actions.hpp"
+#include "context.hpp"
#include "luamanagerimp.hpp"
namespace sol
diff --git a/apps/openmw/mwlua/inputbindings.hpp b/apps/openmw/mwlua/inputbindings.hpp
index 195f69f5f9..e9a19ed34d 100644
--- a/apps/openmw/mwlua/inputbindings.hpp
+++ b/apps/openmw/mwlua/inputbindings.hpp
@@ -3,11 +3,11 @@
#include
-#include "context.hpp"
-
namespace MWLua
{
- sol::table initInputPackage(const Context&);
+ struct Context;
+
+ sol::table initInputPackage(const Context& context);
}
#endif // MWLUA_INPUTBINDINGS_H
diff --git a/apps/openmw/mwlua/landbindings.cpp b/apps/openmw/mwlua/landbindings.cpp
index 3f85e2b066..2b053802db 100644
--- a/apps/openmw/mwlua/landbindings.cpp
+++ b/apps/openmw/mwlua/landbindings.cpp
@@ -1,14 +1,24 @@
#include "landbindings.hpp"
+#include
+#include
+
+#include
+#include
+#include
+
#include
#include
#include
+#include
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwworld/esmstore.hpp"
#include "../mwworld/worldmodel.hpp"
+
+#include "context.hpp"
#include "object.hpp"
namespace
diff --git a/apps/openmw/mwlua/landbindings.hpp b/apps/openmw/mwlua/landbindings.hpp
index 8cdf30046b..f38d260759 100644
--- a/apps/openmw/mwlua/landbindings.hpp
+++ b/apps/openmw/mwlua/landbindings.hpp
@@ -1,10 +1,12 @@
#ifndef MWLUA_LANDBINDINGS_H
#define MWLUA_LANDBINDINGS_H
-#include "context.hpp"
+#include
namespace MWLua
{
+ struct Context;
+
sol::table initCoreLandBindings(const Context& context);
}
diff --git a/apps/openmw/mwlua/localscripts.cpp b/apps/openmw/mwlua/localscripts.cpp
index d784328035..99c994304b 100644
--- a/apps/openmw/mwlua/localscripts.cpp
+++ b/apps/openmw/mwlua/localscripts.cpp
@@ -1,9 +1,5 @@
#include "localscripts.hpp"
-#include
-#include
-#include
-
#include "../mwbase/environment.hpp"
#include "../mwbase/mechanicsmanager.hpp"
#include "../mwmechanics/aicombat.hpp"
@@ -232,7 +228,7 @@ namespace MWLua
[&](LuaUtil::LuaView& view) { addPackage("openmw.self", sol::make_object(view.sol(), &mData)); });
registerEngineHandlers({ &mOnActiveHandlers, &mOnInactiveHandlers, &mOnConsumeHandlers, &mOnActivatedHandlers,
&mOnTeleportedHandlers, &mOnAnimationTextKeyHandlers, &mOnPlayAnimationHandlers, &mOnSkillUse,
- &mOnSkillLevelUp });
+ &mOnSkillLevelUp, &mOnJailTimeServed });
}
void LocalScripts::setActive(bool active, bool callHandlers)
diff --git a/apps/openmw/mwlua/localscripts.hpp b/apps/openmw/mwlua/localscripts.hpp
index b3ec647d0e..c51d2d8c19 100644
--- a/apps/openmw/mwlua/localscripts.hpp
+++ b/apps/openmw/mwlua/localscripts.hpp
@@ -1,9 +1,7 @@
#ifndef MWLUA_LOCALSCRIPTS_H
#define MWLUA_LOCALSCRIPTS_H
-#include
-#include
-#include
+#include
#include
#include
@@ -89,6 +87,7 @@ namespace MWLua
{
callEngineHandlers(mOnSkillLevelUp, skillId, source);
}
+ void onJailTimeServed(int days) { callEngineHandlers(mOnJailTimeServed, days); }
void applyStatsCache();
@@ -118,6 +117,7 @@ namespace MWLua
EngineHandlerList mOnPlayAnimationHandlers{ "_onPlayAnimation" };
EngineHandlerList mOnSkillUse{ "_onSkillUse" };
EngineHandlerList mOnSkillLevelUp{ "_onSkillLevelUp" };
+ EngineHandlerList mOnJailTimeServed{ "_onJailTimeServed" };
};
}
diff --git a/apps/openmw/mwlua/luabindings.hpp b/apps/openmw/mwlua/luabindings.hpp
index 749987e5b2..e7b73dbca1 100644
--- a/apps/openmw/mwlua/luabindings.hpp
+++ b/apps/openmw/mwlua/luabindings.hpp
@@ -1,29 +1,30 @@
#ifndef MWLUA_LUABINDINGS_H
#define MWLUA_LUABINDINGS_H
-#include