mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-16 03:16:33 +00:00
Use Context::initializeOnce
This commit is contained in:
parent
183652e51d
commit
b61d8fb585
1 changed files with 27 additions and 29 deletions
|
@ -299,9 +299,8 @@ namespace MWLua
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (view["openmw_cellbindings"] != sol::nil)
|
if (context.initializeOnce("openmw_cellbindings"))
|
||||||
return; // Only add the usertype once
|
{
|
||||||
|
|
||||||
auto pathGridT = view.new_usertype<ESM::Pathgrid>("ESM3_PathGrid");
|
auto pathGridT = view.new_usertype<ESM::Pathgrid>("ESM3_PathGrid");
|
||||||
pathGridT[sol::meta_function::to_string] = [](const ESM::Pathgrid& rec) -> std::string {
|
pathGridT[sol::meta_function::to_string] = [](const ESM::Pathgrid& rec) -> std::string {
|
||||||
return "ESM3_PathGrid[" + rec.mCell.toDebugString() + "]";
|
return "ESM3_PathGrid[" + rec.mCell.toDebugString() + "]";
|
||||||
|
@ -326,8 +325,7 @@ namespace MWLua
|
||||||
}
|
}
|
||||||
return points;
|
return points;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
view["openmw_cellbindings"] = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void initCellBindingsForLocalScripts(const Context& context)
|
void initCellBindingsForLocalScripts(const Context& context)
|
||||||
|
|
Loading…
Reference in a new issue