Replaced c style cast with static_cast and fixed generate script

This commit is contained in:
2020-05-14 18:03:16 +02:00
parent c9f05af6c9
commit e4adee0e8c
8 changed files with 20 additions and 14 deletions

View File

@@ -77,6 +77,7 @@ namespace ecs::lua {
};
preload["ecs.LuaComponent"] = [&lua] {
// @todo Do we want to register this into the global namespace?
lua.new_usertype<LuaComponent>("LuaComponent",
"__index", [] (LuaComponent* thiz, std::string key) {
return thiz->table[key];
@@ -210,7 +211,7 @@ namespace ecs::lua {
}));
component.set_function("_convert", [] (ecs::Component* component) {
return (LuaComponent*)component;
return static_cast<LuaComponent*>(component);
});
return component;