Skip to content

Commit

Permalink
fix self refrence for Color
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Auto committed Jul 2, 2024
1 parent a80063c commit 649bee7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/game_api/script/usertypes/entity_lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "render_api.hpp" // for RenderInfo, RenderInfo::flip_horiz...
#include "script/lua_backend.hpp" // for LuaBackend
#include "script/safe_cb.hpp" // for make_safe_cb
#include "script/sol_helper.hpp" // for self_return

namespace NEntity
{
Expand Down Expand Up @@ -50,10 +51,10 @@ void register_usertypes(sol::state& lua)
color_type["fuchsia"] = &Color::fuchsia;
color_type["purple"] = &Color::purple;
color_type["get_rgba"] = &Color::get_rgba;
color_type["set_rgba"] = &Color::set_rgba;
color_type["set_rgba"] = self_return<&Color::set_rgba>();
color_type["get_ucolor"] = &Color::get_ucolor;
color_type["set_ucolor"] = &Color::set_ucolor;
color_type["set"] = &Color::set;
color_type["set_ucolor"] = self_return<&Color::set_ucolor>();
color_type["set"] = self_return<&Color::set>();

/// Used in EntityDB
lua.new_usertype<Animation>(
Expand Down
2 changes: 1 addition & 1 deletion src/game_api/script/usertypes/hitbox_lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void register_usertypes(sol::state& lua)

auto offset = sol::overload(
self_return<static_cast<Triangle& (Triangle::*)(const Vec2&)>(&Triangle::offset)>(),
self_return < static_cast<Triangle& (Triangle::*)(float, float)>(&Triangle::offset)>());
self_return<static_cast<Triangle& (Triangle::*)(float, float)>(&Triangle::offset)>());
auto is_point_inside_triangle = sol::overload(
static_cast<bool (Triangle::*)(const Vec2) const>(&Triangle::is_point_inside),
static_cast<bool (Triangle::*)(const Vec2, float) const>(&Triangle::is_point_inside),
Expand Down

0 comments on commit 649bee7

Please sign in to comment.