]> git.pond.sub.org Git - empserver/commitdiff
(att_estimate_defense, att_get_offense): Rename. Remove dead code and
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 20 May 2006 15:17:30 +0000 (15:17 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 20 May 2006 15:17:30 +0000 (15:17 +0000)
unused last parameter.  Callers changed.

include/combat.h
src/lib/commands/assa.c
src/lib/commands/atta.c
src/lib/commands/boar.c
src/lib/commands/lboard.c
src/lib/commands/para.c
src/lib/subs/attsub.c

index 594505f82c6f05fdaf786d0d32df6ff8bbb10b42..7c539c5966e2068c3efef19ff7b9254c2976c798 100644 (file)
@@ -81,8 +81,8 @@ extern int att_ask_support(int, int *, int *, int *, int *);
 extern int att_ask_offense(int, struct combat *, struct combat *,
                           struct emp_qelem *, int *, int *);
 extern double sector_strength(struct sctstr *);
-extern int att_estimate_defense(int, struct combat *, struct emp_qelem *,
-                               struct combat *, int);
+extern int att_get_offense(int, struct combat *, struct emp_qelem *,
+                          struct combat *);
 extern int att_empty_attack(int, int, struct combat *);
 extern int att_get_defense(struct emp_qelem *, struct combat *,
                           struct emp_qelem *, int, int);
index 325e0b9890d06a17166d99c656d98ffa3c875284..4e7d35f77a72b2cf2c03d7ac4fabe2bf075d776b 100644 (file)
@@ -129,11 +129,7 @@ assa(void)
        return RET_OK;
     }
 
-    /*
-     * Estimate the defense strength and give the player a chance to abort
-     */
-
-    ototal = att_estimate_defense(A_ASSAULT, off, &olist, def, a_spy);
+    ototal = att_get_offense(A_ASSAULT, off, &olist, def);
     if (att_abort(A_ASSAULT, off, def)) {
        pr("Assault aborted\n");
        att_empty_attack(A_ASSAULT, 0, def);
index db7d52523e7c68b882d3bc98e7b5b72d4b6a1eeb..c38e3f59bbb41c88a0f9070814f0752ef24f5347 100644 (file)
@@ -120,11 +120,7 @@ atta(void)
        return att_free_lists(&olist, 0);
     }
 
-    /*
-     * Estimate the defense strength and give the player a chance to abort
-     */
-
-    ototal = att_estimate_defense(A_ATTACK, off, &olist, def, a_spy);
+    ototal = att_get_offense(A_ATTACK, off, &olist, def);
     if (att_abort(A_ATTACK, off, def)) {
        pr("Attack aborted\n");
        att_empty_attack(A_ATTACK, 0, def);
index 08db07e8476f36f32e01e013ac59320a541b6318..4ba1f3aacbd3715f5b705db02c4a456ebb6728d5 100644 (file)
@@ -147,11 +147,7 @@ boar(void)
        return att_free_lists(&olist, 0);
     }
 
-    /*
-     * Estimate the defense strength and give the player a chance to abort
-     */
-
-    ototal = att_estimate_defense(A_BOARD, off, &olist, def, a_spy);
+    ototal = att_get_offense(A_BOARD, off, &olist, def);
     if (att_abort(A_BOARD, off, def)) {
        pr("Board aborted\n");
        att_empty_attack(A_BOARD, 0, def);
index 03ed71c4c3a235572d2fad5f5a57b2f6f3238f0a..a6e2442fa66366e9e7c76c655102b31bff839c6a 100644 (file)
@@ -118,11 +118,7 @@ lboa(void)
        return att_free_lists(&olist, 0);
     }
 
-    /*
-     * Estimate the defense strength and give the player a chance to abort
-     */
-
-    ototal = att_estimate_defense(A_LBOARD, off, &olist, def, a_spy);
+    ototal = att_get_offense(A_LBOARD, off, &olist, def);
     if (att_abort(A_LBOARD, off, def)) {
        pr("Land unit boarding aborted\n");
        att_empty_attack(A_LBOARD, 0, def);
index f0bec69f5379de2f5ec3fccff6e185f7130675a9..62b0a6a917158e1f2dd1c0c1ec7e745c0691e1ce 100644 (file)
@@ -168,9 +168,7 @@ paradrop(struct emp_qelem *list, coord x, coord y)
        return RET_OK;
     }
 
-    /* Get ototal */
-
-    ototal = att_estimate_defense(A_PARA, off, &olist, def, a_spy);
+    ototal = att_get_offense(A_PARA, off, &olist, def);
     if (att_abort(A_PARA, off, def)) {
        pr("Air-assault aborted\n");
        return RET_OK;
index 034d9717a67aca20e1c17096c5d9abdf8c453baf..39321771d8ab2795a77d9dfe9b51fc548e40b765 100644 (file)
@@ -1107,11 +1107,9 @@ att_combat_eff(struct combat *com)
  * Estimate the defense strength and give the attacker a chance to abort
  * if the odds are less than 50%
  */
-
 int
-att_estimate_defense(int combat_mode, struct combat *off,
-                    struct emp_qelem *olist, struct combat *def,
-                    int a_spy)
+att_get_offense(int combat_mode, struct combat *off,
+               struct emp_qelem *olist, struct combat *def)
 {
     int ototal;
     int estimate;
@@ -1128,30 +1126,6 @@ att_estimate_defense(int combat_mode, struct combat *off,
     if (combat_mode == A_PARA)
        return ototal;
     pr("\n             Initial attack strength: %8d\n", ototal);
-
-    estimate = att_combat_eff(def) * roundintby(def->troops, 10);
-    estimate += att_combat_eff(def) * get_dlist(def, 0, a_spy, 0);
-
-    /*
-     * Calculate the initial (pre-support) attack odds.  If they're less
-     * than 50%, ask for a confirmation.
-     */
-
-    odds = (int)(att_calcodds(ototal, estimate) * 100);
-
-/*
-       if (odds < 50) {
-               pr("          Estimated defense strength: %8d\n", estimate);
-               pr("                      Estimated odds: %8d%%\n\n",odds);
-               sprintf(prompt, "Are you sure you want to %s [yn]? ",
-                       att_mode[combat_mode]);
-               if (!confirm(prompt))
-                       return abort_attack();
-               ototal = get_ototal(combat_mode, off, olist,1.0,1);
-               if (att_empty_attack(combat_mode, ototal, def))
-                       return abort_attack();
-       }
- */
     return ototal;
 }