From b19c2a6c037f91397aa533f69eb860f64abb6004 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 4 Nov 2005 18:09:08 +0000 Subject: [PATCH] (nullify_objects): Patch intrchr[] according to opt_NO_LCMS, opt_NO_HCMS. This fixes output of `show se b', which used not to reflect these options. (improve): Simplify. --- src/lib/commands/improve.c | 10 ++-------- src/server/main.c | 6 ++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/commands/improve.c b/src/lib/commands/improve.c index ff4348b2..4ea943cd 100644 --- a/src/lib/commands/improve.c +++ b/src/lib/commands/improve.c @@ -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; diff --git a/src/server/main.c b/src/server/main.c index 21b0e31c..6b01678a 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -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)