Author: sveinung
Date: Thu Nov 10 01:23:32 2016
New Revision: 34464

URL: http://svn.gna.org/viewcvs/freeciv?rev=34464&view=rev
Log:
Prepare for ruleset derived action data.

Introduce the new function actions_rs_pre_san_gen(). It generates data that
is based on the loaded ruleset but needed before ruleset sanity checking and
ruleset compatibility upgrade.

See patch #7963

Modified:
    trunk/client/packhand.c
    trunk/common/actions.c
    trunk/common/actions.h
    trunk/server/ruleset.c

Modified: trunk/client/packhand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/packhand.c?rev=34464&r1=34463&r2=34464&view=diff
==============================================================================
--- trunk/client/packhand.c     (original)
+++ trunk/client/packhand.c     Thu Nov 10 01:23:32 2016
@@ -3202,6 +3202,9 @@
 
   /* Setup road integrators caches */
   road_integrators_cache_init();
+
+  /* Pre calculate action related data. */
+  actions_rs_pre_san_gen();
 
   /* Setup unit unknown move cost caches */
   unit_type_iterate(ptype) {

Modified: trunk/common/actions.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=34464&r1=34463&r2=34464&view=diff
==============================================================================
--- trunk/common/actions.c      (original)
+++ trunk/common/actions.c      Thu Nov 10 01:23:32 2016
@@ -501,6 +501,15 @@
 }
 
 /**************************************************************************
+  Generate action related data based on the currently loaded ruleset. Done
+  before ruleset sanity checking and ruleset compatibility post
+  processing.
+**************************************************************************/
+void actions_rs_pre_san_gen(void)
+{
+}
+
+/**************************************************************************
   Free the actions and the action enablers.
 **************************************************************************/
 void actions_free(void)

Modified: trunk/common/actions.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.h?rev=34464&r1=34463&r2=34464&view=diff
==============================================================================
--- trunk/common/actions.h      (original)
+++ trunk/common/actions.h      Thu Nov 10 01:23:32 2016
@@ -319,6 +319,7 @@
 
 /* Initialization */
 void actions_init(void);
+void actions_rs_pre_san_gen(void);
 void actions_free(void);
 
 bool actions_are_ready(void);

Modified: trunk/server/ruleset.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/ruleset.c?rev=34464&r1=34463&r2=34464&view=diff
==============================================================================
--- trunk/server/ruleset.c      (original)
+++ trunk/server/ruleset.c      Thu Nov 10 01:23:32 2016
@@ -8015,6 +8015,7 @@
     /* Prepare caches we want to sanity check. */
     role_unit_precalcs();
     road_integrators_cache_init();
+    actions_rs_pre_san_gen();
 
     ok = autoadjust_ruleset_data()
       && sanity_check_ruleset_data(compat_info.compat_mode);


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

Reply via email to