]> git.pond.sub.org Git - empserver/commitdiff
(s_commod): Move initialization of `min' before first use.
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 1 Mar 2004 14:23:44 +0000 (14:23 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 1 Mar 2004 14:23:44 +0000 (14:23 +0000)
(itemname): Unused, remove.

src/lib/subs/supply.c

index 1fd810cc02c96905d2c895d2fc081b2b8e019514..514c7eb2d84f13af4ce6f81f71feffa9c889c1e3 100644 (file)
@@ -50,7 +50,6 @@
 #include "prototypes.h"
 
 static int get_minimum(struct lndstr *, int);
-static s_char *itemname(int);
 static int s_commod(int, int, int, int, int, int);
 
 /*
@@ -410,6 +409,7 @@ s_commod(int own, int x, int y, int type, int total_wanted,
        }
 
        getvec(VT_ITEM, vec, (s_char *)&land, EF_LAND);
+       min = get_minimum(&land, type);
        ip = &ichr[type];
        weight = ((double)ip->i_lbs);
        mobcost = move_cost * weight;
@@ -417,7 +417,6 @@ s_commod(int own, int x, int y, int type, int total_wanted,
            can_move = ((double)land.lnd_mobil / mobcost);
        else
            can_move = vec[type] - min;
-       min = get_minimum(&land, type);
        if (can_move > (vec[type] - min))
            can_move = (vec[type] - min);
 
@@ -454,20 +453,6 @@ s_commod(int own, int x, int y, int type, int total_wanted,
 }
 
 
-static s_char *
-itemname(int type)
-{
-    register int t;
-    register struct ichrstr *ip;
-
-    t = V_ITEM(type);
-    for (ip = &ichr[1]; ip->i_mnem != 0; ip++) {
-       if (t == ip->i_vtype)
-           return ip->i_name;
-    }
-    return 0;
-}
-
 /*
  * We want to get enough shells to fire once,
  * one update's worth of food, enough fuel for