From 0121c6ac9d9777d8596408022b51c5dfea834b0d Mon Sep 17 00:00:00 2001 From: Allanis Date: Sat, 17 May 2014 14:29:57 +0100 Subject: [PATCH] [Add] Added __tostring metatable functions. --- src/llua_faction.c | 2 ++ src/llua_space.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/llua_faction.c b/src/llua_faction.c index 17da547..9688f11 100644 --- a/src/llua_faction.c +++ b/src/llua_faction.c @@ -28,6 +28,7 @@ static int factionL_modplayerraw(lua_State* L); static int factionL_playerstanding(lua_State* L); static const luaL_reg faction_methods[] = { { "__eq", factionL_eq }, + { "__tostring", factionL_name }, { "name", factionL_name }, { "longname", factionL_longname }, { "areEnemeies", factionL_areenemies }, @@ -40,6 +41,7 @@ static const luaL_reg faction_methods[] = { static const luaL_reg faction_methods_cond[] = { { "__eq", factionL_eq }, + { "__tostring", factionL_name }, { "name", factionL_name }, { "longname", factionL_longname }, { "areEnemeies", factionL_areenemies }, diff --git a/src/llua_space.c b/src/llua_space.c index 545aa15..40624b9 100644 --- a/src/llua_space.c +++ b/src/llua_space.c @@ -32,6 +32,7 @@ static int planetL_services(lua_State* L); static int planetL_position(lua_State* L); static const luaL_reg planet_methods[] = { { "__eq", planetL_eq }, + { "__tostring", planetL_name }, { "name", planetL_name }, { "faction", planetL_faction }, { "class", planetL_class }, @@ -47,6 +48,7 @@ static int systemL_faction(lua_State* L); static int systemL_jumpdistance(lua_State* L); static const luaL_reg system_methods[] = { { "__eq", systemL_eq }, + { "__tostring", systemL_name }, { "name", systemL_name }, { "faction", systemL_faction }, { "jumpDist", systemL_jumpdistance },