1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 09:09:43 +00:00

Added delayed action

This commit is contained in:
Tobias Tribble 2023-06-08 23:50:54 -05:00
parent 41a2c82f93
commit 0e6155c529

View file

@ -280,8 +280,9 @@ namespace MWLua
if constexpr (std::is_same_v<ObjectT, GObject>)
{ // Only for global scripts
objectT["setScale"] = [](const GObject& object, float scale) {
MWBase::Environment::get().getWorld()->scaleObject(object.ptr(), scale);
objectT["setScale"] = [context](const GObject& object, float scale) {
context.mLuaManager->addAction(
[object, scale] { MWBase::Environment::get().getWorld()->scaleObject(object.ptr(), scale); });
};
objectT["addScript"] = [context](const GObject& object, std::string_view path, sol::object initData) {
const LuaUtil::ScriptsConfiguration& cfg = context.mLua->getConfiguration();