mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-22 19:39:32 -04:00
Change method name and error message
This commit is contained in:
parent
6d5da282a5
commit
51a4f8749e
@ -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();
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user