Change method name and error message

This commit is contained in:
Evil Eye 2025-09-17 21:11:57 +02:00
parent 6d5da282a5
commit 51a4f8749e
2 changed files with 3 additions and 3 deletions

View File

@ -174,7 +174,7 @@ namespace MWLua
void sendLocalEvent(
const MWWorld::Ptr& target, const std::string& name, const std::optional<sol::table>& data = std::nullopt);
bool savingAllowed() const { return mAllowSaving; }
bool isSynchronizedUpdateRunning() const { return mAllowSaving; }
private:
void initConfiguration();

View File

@ -74,8 +74,8 @@ namespace MWLua
};
api["saveGame"] = [context](std::string_view description, sol::optional<std::string_view> slotName) {
if (!context.mLuaManager->savingAllowed())
throw std::runtime_error("The game cannot be saved at the moment");
if (!context.mLuaManager->isSynchronizedUpdateRunning())
throw std::runtime_error("The game cannot be saved outside events");
MWBase::StateManager* manager = MWBase::Environment::get().getStateManager();
const MWState::Character* character = manager->getCurrentCharacter();
const MWState::Slot* slot = nullptr;