Author: sveinung
Date: Tue Apr 25 23:13:52 2017
New Revision: 35294

URL: http://svn.gna.org/viewcvs/freeciv?rev=35294&view=rev
Log:
Server setting module bool value checker.

Make it easy to check the value of Boolean server settings that aren't sent
in PACKET_GAME_INFO by adding a boolean server setting value checker to the
server_settings module.

See hrm Feature #654853

Modified:
    branches/S3_0/common/server_settings.c
    branches/S3_0/common/server_settings.h

Modified: branches/S3_0/common/server_settings.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/common/server_settings.c?rev=35294&r1=35293&r2=35294&view=diff
==============================================================================
--- branches/S3_0/common/server_settings.c      (original)
+++ branches/S3_0/common/server_settings.c      Tue Apr 25 23:13:52 2017
@@ -51,3 +51,13 @@
 {
   return sset_type_is_valid(server_setting_type_get(id));
 }
+
+/***************************************************************************
+  Returns the value of the server setting with the specified id.
+***************************************************************************/
+bool server_setting_value_bool_get(server_setting_id id)
+{
+  fc_assert_ret_val(server_setting_type_get(id) == SST_BOOL, FALSE);
+
+  return fc_funcs->server_setting_val_bool_get(id);
+}

Modified: branches/S3_0/common/server_settings.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/common/server_settings.h?rev=35294&r1=35293&r2=35294&view=diff
==============================================================================
--- branches/S3_0/common/server_settings.h      (original)
+++ branches/S3_0/common/server_settings.h      Tue Apr 25 23:13:52 2017
@@ -43,6 +43,8 @@
 
 const char *server_setting_name_get(server_setting_id id);
 
+bool server_setting_value_bool_get(server_setting_id id);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */


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

Reply via email to