Skip to content

Commit 7f76fd5

Browse files
committed
fix(color): Get/Set
1 parent c79a472 commit 7f76fd5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/plugins/loader/scripting/sdk/baseclasses.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ std::string Vector4D_tostring(Vector4D* v1)
200200

201201
int Color_index(lua_State* L)
202202
{
203-
Color* v = *static_cast<Color**>(luaL_checkudata(L, 1, "Color"));
203+
Color* v = *static_cast<Color**>(luaL_checkudata(L, 1, typeid(Color).name()));
204204
std::string key = luaL_checkstring(L, 2);
205205

206206
if (key == "r")
@@ -224,7 +224,7 @@ int Color_index(lua_State* L)
224224
return 1;
225225
}
226226

227-
luaL_getmetatable(L, "Color");
227+
luaL_getmetatable(L, typeid(Color).name());
228228
lua_pushstring(L, key.c_str());
229229
lua_rawget(L, -2);
230230
return 1;
@@ -246,7 +246,7 @@ JSValue Color_indexJS(JSContext* ctx, JSValue this_arg, int argc, JSValue* argv)
246246

247247
int Color_newindex(lua_State* L)
248248
{
249-
Color* v = *static_cast<Color**>(luaL_checkudata(L, 1, "Color"));
249+
Color* v = *static_cast<Color**>(luaL_checkudata(L, 1, typeid(Color).name()));
250250
std::string key = luaL_checkstring(L, 2);
251251

252252
if (key == "r")

0 commit comments

Comments
 (0)