mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Modify __tostring so it also shows a pointer, like lua does for tables
This should make it easier to identify unique objects. Also modified internal code relying on tostring behaviour, and it should now call its type method instead.
This commit is contained in:
@@ -31,7 +31,7 @@ static love::Type extractudatatype(lua_State *L, int idx)
|
||||
Type t = INVALID_ID;
|
||||
if (!lua_isuserdata(L, idx))
|
||||
return t;
|
||||
if (luaL_getmetafield(L, idx, "__tostring") == 0)
|
||||
if (luaL_getmetafield(L, idx, "type") == 0)
|
||||
return t;
|
||||
lua_pushvalue(L, idx);
|
||||
int result = lua_pcall(L, 1, 1, 0);
|
||||
|
||||
Reference in New Issue
Block a user