Author: cazfi
Date: Sat Dec 20 21:21:42 2014
New Revision: 27368

URL: http://svn.gna.org/viewcvs/freeciv?rev=27368&view=rev
Log:
Renamed process_defender_want() as dai_process_defender_want() and made it 
available
outside advmilitary module.

See patch #5562

Modified:
    trunk/ai/default/advmilitary.c
    trunk/ai/default/advmilitary.h

Modified: trunk/ai/default/advmilitary.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/advmilitary.c?rev=27368&r1=27367&r2=27368&view=diff
==============================================================================
--- trunk/ai/default/advmilitary.c      (original)
+++ trunk/ai/default/advmilitary.c      Sat Dec 20 21:21:42 2014
@@ -741,9 +741,9 @@
   type in choice. Also sets the technology want for the units we can't 
   build yet.
 **************************************************************************/
-static bool process_defender_want(struct ai_type *ait, struct player *pplayer,
-                                  struct city *pcity, unsigned int danger,
-                                  struct adv_choice *choice)
+bool dai_process_defender_want(struct ai_type *ait, struct player *pplayer,
+                               struct city *pcity, unsigned int danger,
+                               struct adv_choice *choice)
 {
   const struct research *presearch = research_get(pplayer);
   /* FIXME: We check if the city has *some* defensive structure,
@@ -1467,7 +1467,7 @@
     if (our_def == 0) {
       /* Build defensive unit first! Walls will help nothing if there's
        * nobody behind them. */
-      if (process_defender_want(ait, pplayer, pcity, danger, choice)) {
+      if (dai_process_defender_want(ait, pplayer, pcity, danger, choice)) {
         choice->want = 100 + danger;
         build_walls = FALSE;
 
@@ -1506,7 +1506,7 @@
                  choice->want);
       } else if ((danger > 0 && num_defenders <= urgency) || martial_value > 
0) {
         /* Consider building defensive units */
-        if (process_defender_want(ait, pplayer, pcity, danger, choice)) {
+        if (dai_process_defender_want(ait, pplayer, pcity, danger, choice)) {
           /* Potential defender found */
           if (urgency == 0
               && choice->value.utype->defense_strength == 1) {

Modified: trunk/ai/default/advmilitary.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/ai/default/advmilitary.h?rev=27368&r1=27367&r2=27368&view=diff
==============================================================================
--- trunk/ai/default/advmilitary.h      (original)
+++ trunk/ai/default/advmilitary.h      Sat Dec 20 21:21:42 2014
@@ -36,5 +36,8 @@
                                   const struct unit_type *punittype);
 int dai_unit_attack_desirability(struct ai_type *ait,
                                  const struct unit_type *punittype);
+bool dai_process_defender_want(struct ai_type *ait, struct player *pplayer,
+                               struct city *pcity, unsigned int danger,
+                               struct adv_choice *choice);
 
 #endif  /* FC__ADVMILITARY_H */


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

Reply via email to