]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/atta.c
Update copyright notice
[empserver] / src / lib / commands / atta.c
index ffd3a0b30c8ba74580d9287dc01fca6e30933b10..a327e764673c3cdabc1ab1420979f1488e83938d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
  *
  *  ---
  *
- *  See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- *  related information and legal notices. It is expected that any future
- *  projects/authors will amend these files as needed.
+ *  See files README, COPYING and CREDITS in the root of the source
+ *  tree for related information and legal notices.  It is expected
+ *  that future projects/authors will amend these files as needed.
  *
  *  ---
  *
  *  atta.c: Attack another sector
- * 
+ *
  *  Known contributors to this file:
  *     Dave Pare
  *     Ken Stevens, 1995
 
 #include <config.h>
 
-#include "misc.h"
-#include "player.h"
-#include "file.h"
-#include "sect.h"
-#include "path.h"
-#include "nat.h"
-#include "xy.h"
+#include "combat.h"
+#include "commands.h"
 #include "land.h"
-#include "nsc.h"
 #include "mission.h"
+#include "path.h"
 #include "ship.h"
-#include "combat.h"
-#include "commands.h"
 
 int
 atta(void)
@@ -65,8 +58,8 @@ atta(void)
     double osupport = 1.0;     /* attack support */
     double dsupport = 1.0;     /* defense support */
     int last, n;
-    s_char *p;
-    s_char buf[1024];
+    char *p;
+    char buf[1024];
     int rel;
 
     att_combat_init(def, EF_SECTOR);
@@ -80,7 +73,7 @@ atta(void)
        return RET_SYN;
     if (!sarg_xy(p, &def->x, &def->y))
        return RET_SYN;
-    if (att_abort(A_ATTACK, 0, def))
+    if (att_abort(A_ATTACK, NULL, def))
        return RET_FAIL;
 
     /* Show what we're attacking, and check treaties */
@@ -91,7 +84,7 @@ atta(void)
     /* Ask about offensive support */
 
     att_ask_support(2, &fort_sup, &ship_sup, &land_sup, &plane_sup);
-    if (att_abort(A_ATTACK, 0, def)) {
+    if (att_abort(A_ATTACK, NULL, def)) {
        att_empty_attack(A_ATTACK, 0, def);
        return RET_OK;
     }
@@ -117,18 +110,14 @@ atta(void)
     if (att_abort(A_ATTACK, off, def)) {
        pr("Attack aborted\n");
        att_empty_attack(A_ATTACK, 0, def);
-       return att_free_lists(&olist, 0);
+       return att_free_lists(&olist, NULL);
     }
 
-    /*
-     * 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);
-       return att_free_lists(&olist, 0);
+       return att_free_lists(&olist, NULL);
     }
 
     /*