Forgot this

This commit is contained in:
Federico Cecchetto 2021-11-02 02:14:06 +01:00
parent bdb6b7324e
commit b6400b2b9f

View File

@ -283,6 +283,23 @@ namespace scripting::lua
return scripting::lua::entity_to_struct(s, id);
};
entity_type["scriptcall"] = [](const entity& entity, const sol::this_state s, const std::string& filename,
const std::string function, sol::variadic_args va)
{
std::vector<script_value> arguments{};
for (auto arg : va)
{
arguments.push_back(convert({s, arg}));
}
notifies::hook_enabled = false;
const auto result = convert(s, call_script_function(entity, filename, function, arguments));
notifies::hook_enabled = true;
return result;
};
struct game
{
};