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:
parent
41a2c82f93
commit
0e6155c529
1 changed files with 3 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue