]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/mine.c
commands: Rename the command functions
[empserver] / src / lib / commands / mine.c
index 99dc5753408a6d9766d9a8e2d630b07ae50604a5..20966fbeb70b613f91d54015523f69bd0a3eb5fc 100644 (file)
@@ -1,11 +1,11 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
- *                           Ken Stevens, Steve McClure
+ *  Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *                Ken Stevens, Steve McClure, Markus Armbruster
  *
- *  This program is free software; you can redistribute it and/or modify
+ *  Empire is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
+ *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
@@ -14,8 +14,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  *  ---
  *
@@ -28,7 +27,7 @@
  *  mine.c: Lay mines from ships or units
  *
  *  Known contributors to this file:
- *     Markus Armbruster, 2004-2009
+ *     Markus Armbruster, 2004-2010
  */
 
 #include <config.h>
@@ -42,7 +41,7 @@
  * format: mine <SHIPS> <NUMBER MINES>
  */
 int
-mine(void)
+c_mine(void)
 {
     struct shpstr ship;
     struct sctstr sect;
@@ -68,7 +67,7 @@ mine(void)
            continue;
        mines_avail = MIN(shells, mines);
        if (getsect(ship.shp_x, ship.shp_y, &sect) == 0 ||
-           !SCT_MINES_ARE_SEAMINES(&sect)) {
+           sect.sct_type != SCT_WATER) {
            pr("You can't lay mines there!!\n");
            continue;
        }
@@ -89,7 +88,7 @@ mine(void)
  * format: landmine <UNITS> <NUMBER MINES>
  */
 int
-landmine(void)
+c_lmine(void)
 {
     struct lndstr land;
     struct sctstr sect;
@@ -109,7 +108,7 @@ landmine(void)
            continue;
        if (land.lnd_ship >= 0 || land.lnd_land >= 0) {
            pr("%s is on a %s\n", prland(&land),
-              land. lnd_ship >= 0 ? "ship" : "land unit");
+              land.lnd_ship >= 0 ? "ship" : "land unit");
            continue;
        }
        if (land.lnd_mobil < 1) {
@@ -152,7 +151,7 @@ landmine(void)
        if (total_mines_laid == mines_wanted) {
            pr("%s laid a total of %d mines in %s",
               prland(&land), total_mines_laid,
-              xyas(sect.sct_x, sect.sct_y, land.lnd_own));
+              xyas(sect.sct_x, sect.sct_y, player->cnum));
            if (!land.lnd_item[I_SHELL])
                pr(" but is now out of shells\n");
            else
@@ -163,7 +162,7 @@ landmine(void)
               prland(&land),
               land.lnd_mobil > 0 ? "shells" : "mobility",
               total_mines_laid,
-              xyas(sect.sct_x, sect.sct_y, land.lnd_own));
+              xyas(sect.sct_x, sect.sct_y, player->cnum));
     }
     return RET_OK;
 }