]> git.pond.sub.org Git - empserver/commitdiff
(nullify_objects): Patch intrchr[] according to opt_NO_LCMS,
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 4 Nov 2005 18:09:08 +0000 (18:09 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 4 Nov 2005 18:09:08 +0000 (18:09 +0000)
opt_NO_HCMS.  This fixes output of `show se b', which used not to
reflect these options.
(improve): Simplify.

src/lib/commands/improve.c
src/server/main.c

index ff4348b29b0631af6afcf08aa5f03d58225b5041..4ea943cd8dc0df22e6aa22bf457da1fd0a566b24 100644 (file)
@@ -112,8 +112,6 @@ improve(void)
        if (!maxup)
            continue;
        lneeded = intrchr[type].in_lcms * maxup;
-       if (opt_NO_LCMS)
-           lneeded = 0;
        if (sect.sct_item[I_LCM] < lneeded) {
            lneeded = sect.sct_item[I_LCM];
            maxup = lneeded / intrchr[type].in_lcms;
@@ -124,8 +122,6 @@ improve(void)
            }
        }
        hneeded = intrchr[type].in_hcms * maxup;
-       if (opt_NO_HCMS)
-           hneeded = 0;
        if (sect.sct_item[I_HCM] < hneeded) {
            hneeded = sect.sct_item[I_HCM];
            maxup = hneeded / intrchr[type].in_hcms;
@@ -168,10 +164,8 @@ improve(void)
        mneeded = intrchr[type].in_mcost * maxup;
        dneeded = intrchr[type].in_dcost * maxup;
        player->dolcost += dneeded;
-       if (!opt_NO_LCMS)
-           sect.sct_item[I_LCM] -= lneeded;
-       if (!opt_NO_HCMS)
-           sect.sct_item[I_HCM] -= hneeded;
+       sect.sct_item[I_LCM] -= lneeded;
+       sect.sct_item[I_HCM] -= hneeded;
        sect.sct_mobil -= mneeded;
        ovalue = value;
        value += maxup;
index 21b0e31c54784adc83d1b25cf43b8579523cb3de..6b01678a5d6471b729274d6fcaaf1878ae2291ab 100644 (file)
@@ -543,6 +543,12 @@ nullify_objects(void)
                pchr[i].p_camt[j] = 0;
        }
     }
+    for (i = 0; intrchr[i].in_name; i++) {
+       if (opt_NO_HCMS)
+           intrchr[i].in_hcms = 0;
+       if (opt_NO_LCMS)
+           intrchr[i].in_lcms = 0;
+    }
 }
 
 #if defined(_WIN32)