]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/supply.c
Move declarations for chance.c to new chance.h
[empserver] / src / lib / subs / supply.c
index b7adfd8519270c288a6d9636eb42f954bec16dd3..ff084dc2d939aef2a4ebda52964172e3eeaddbd8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
 #include <config.h>
 
 #include <math.h>
+#include "chance.h"
 #include "empobj.h"
 #include "file.h"
 #include "land.h"
 #include "nat.h"
 #include "optlist.h"
 #include "path.h"
-#include "player.h"
 #include "prototypes.h"
 #include "sect.h"
 #include "ship.h"
@@ -319,17 +319,16 @@ s_commod(struct empobj *sink, short *vec,
        if (land.lnd_item[type] <= get_minimum(&land, type))
            continue;
 
-       getsect(land.lnd_x, land.lnd_y, &sect);
+       if (land.lnd_ship >= 0) {
+           getsect(land.lnd_x, land.lnd_y, &sect);
+           if (sect.sct_type != SCT_HARBR || sect.sct_effic < 2)
+               continue;
+       }
+
        move_cost = path_find(land.lnd_x, land.lnd_y, x, y, own, MOB_MOVE);
        if (move_cost < 0)
            continue;
 
-       if ((land.lnd_ship >= 0) && (sect.sct_type != SCT_HARBR))
-           continue;
-
-       if ((land.lnd_ship >= 0) && (sect.sct_effic < 2))
-           continue;
-
 #if 0
        /*
         * Recursive supply is disabled for now.  It can introduce