]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/retreat.c
Update copyright notice
[empserver] / src / lib / subs / retreat.c
index 4a20701064c4639f56ae49292063cd7c5091ae08..f51137ba4fc0d0c33d5597056652d46bf46c5e2d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2014, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2015, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -136,15 +136,6 @@ retreat_ship1(struct shpstr *sp, char code, int orig)
     struct mchrstr *mcp;
     int changed;
 
-    if (opt_SAIL) {
-       /* can't retreat a ship that's sailin, bad things happend */
-       if (*sp->shp_path) {
-           wu(0, sp->shp_own,
-              "%s %s,\nbut had sailing orders, and couldn't retreat!\n",
-              prship(sp), conditions[findcondition(code)].desc[orig]);
-           return 0;
-       }
-    }
     /* check crew - uws don't count */
     if (sp->shp_item[I_MILIT] == 0 && sp->shp_item[I_CIVIL] == 0) {
        wu(0, sp->shp_own,
@@ -155,24 +146,20 @@ retreat_ship1(struct shpstr *sp, char code, int orig)
 
     getsect(sp->shp_x, sp->shp_y, &sect);
     switch (shp_check_nav(sp, &sect)) {
-    case NAV_02:
-    case NAV_60:
+    case SHP_STUCK_NOT:
+       break;
+    case SHP_STUCK_CONSTRUCTION:
        wu(0, sp->shp_own,
           "%s %s,\nbut was caught in a construction zone, and couldn't retreat!\n",
           prship(sp), conditions[findcondition(code)].desc[orig]);
        return 0;
-    case NAV_NONE:
-    case NAV_CANAL:
-       wu(0, sp->shp_own,
-          "%s %s,\nbut was landlocked, and couldn't retreat!\n",
-          prship(sp), conditions[findcondition(code)].desc[orig]);
-       return 0;
-    case NAVOK:
-       break;
     default:
        CANT_REACH();
+       /* fall through */
+    case SHP_STUCK_CANAL:
+    case SHP_STUCK_IMPASSABLE:
        wu(0, sp->shp_own,
-          "%s %s,\nbut was subject to an empire error, and couldn't retreat!\n",
+          "%s %s,\nbut was landlocked, and couldn't retreat!\n",
           prship(sp), conditions[findcondition(code)].desc[orig]);
        return 0;
     }
@@ -208,7 +195,7 @@ retreat_ship1(struct shpstr *sp, char code, int orig)
        mobcost = shp_mobcost(sp);
 
        getsect(newx, newy, &sect);
-       if (shp_check_nav(sp, &sect) != NAVOK ||
+       if (shp_check_nav(sp, &sect) != SHP_STUCK_NOT ||
            (sect.sct_own
             && relations_with(sect.sct_own, sp->shp_own) < FRIENDLY)) {
            wu(0, sp->shp_own, "%s %s,\nbut could not retreat to %s!\n",