Author: cazfi
Date: Mon Jul  4 13:57:35 2016
New Revision: 33159

URL: http://svn.gna.org/viewcvs/freeciv?rev=33159&view=rev
Log:
Added lua methods game.rulesetdir() and game.ruleset_name()

See patch #7362

Modified:
    trunk/common/scriptcore/api_game_methods.c
    trunk/common/scriptcore/api_game_methods.h
    trunk/common/scriptcore/tolua_game.pkg

Modified: trunk/common/scriptcore/api_game_methods.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/scriptcore/api_game_methods.c?rev=33159&r1=33158&r2=33159&view=diff
==============================================================================
--- trunk/common/scriptcore/api_game_methods.c  (original)
+++ trunk/common/scriptcore/api_game_methods.c  Mon Jul  4 13:57:35 2016
@@ -70,6 +70,22 @@
 }
 
 /*****************************************************************************
+  Return name of the current ruleset.
+*****************************************************************************/
+const char *api_methods_game_rulesetdir(lua_State *L)
+{
+  return game.server.rulesetdir;
+}
+
+/*****************************************************************************
+  Return name of the current ruleset.
+*****************************************************************************/
+const char *api_methods_game_ruleset_name(lua_State *L)
+{
+  return game.control.name;
+}
+
+/*****************************************************************************
   Return TRUE if pbuilding is a wonder.
 *****************************************************************************/
 bool api_methods_building_type_is_wonder(lua_State *L,

Modified: trunk/common/scriptcore/api_game_methods.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/scriptcore/api_game_methods.h?rev=33159&r1=33158&r2=33159&view=diff
==============================================================================
--- trunk/common/scriptcore/api_game_methods.h  (original)
+++ trunk/common/scriptcore/api_game_methods.h  Mon Jul  4 13:57:35 2016
@@ -26,6 +26,8 @@
 /* Game */
 int api_methods_game_turn(lua_State *L);
 int api_methods_game_turn_deprecated(lua_State *L);
+const char *api_methods_game_rulesetdir(lua_State *L);
+const char *api_methods_game_ruleset_name(lua_State *L);
 
 /* Building Type */
 bool api_methods_building_type_is_wonder(lua_State *L,

Modified: trunk/common/scriptcore/tolua_game.pkg
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/scriptcore/tolua_game.pkg?rev=33159&r1=33158&r2=33159&view=diff
==============================================================================
--- trunk/common/scriptcore/tolua_game.pkg      (original)
+++ trunk/common/scriptcore/tolua_game.pkg      Mon Jul  4 13:57:35 2016
@@ -118,6 +118,12 @@
   /* Deprecated. Use current_turn() to get the real turn number */
   int api_methods_game_turn_deprecated
     @ turn (lua_State *L);
+
+  const char *api_methods_game_rulesetdir
+    @ rulesetdir (lua_State *L);
+
+  const char *api_methods_game_ruleset_name
+    @ ruleset_name (lua_State *L);
 }
 
 /* Module Player. */


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to