From 63d8c3830a009a19b7edec09c3893733632c779b Mon Sep 17 00:00:00 2001 From: Katja Zedel Date: Sun, 4 Feb 2001 07:52:30 +0000 Subject: [PATCH] fix negative tranktwirkungen --- src/common/gamecode/study.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/common/gamecode/study.c b/src/common/gamecode/study.c index 5518d0a6d..d3479a9e6 100644 --- a/src/common/gamecode/study.c +++ b/src/common/gamecode/study.c @@ -1,6 +1,6 @@ /* vi: set ts=2: * - * $Id: study.c,v 1.3 2001/02/03 13:45:30 enno Exp $ + * $Id: study.c,v 1.4 2001/02/04 07:52:30 katze Exp $ * Eressea PB(E)M host Copyright (C) 1998-2000 * Christian Schlittchen (corwin@amber.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de) @@ -324,7 +324,7 @@ learn(void) unit *u; int p; magic_t mtyp; - int i; + int i, l; int warrior_skill; int studycost; @@ -485,12 +485,14 @@ learn(void) } if (get_effect(u, oldpotiontype[P_WISE])) { - a->data.i += min(u->number, get_effect(u, oldpotiontype[P_WISE])) * 10; - change_effect(u, oldpotiontype[P_WISE], -u->number); + l = min(u->number, get_effect(u, oldpotiontype[P_WISE])); + a->data.i += l * 10; + change_effect(u, oldpotiontype[P_WISE], -l); } if (get_effect(u, oldpotiontype[P_FOOL])) { /* Trank "Dumpfbackenbrot" */ - a->data.i -= min(u->number, get_effect(u, oldpotiontype[P_FOOL])) * 30; - change_effect(u, oldpotiontype[P_FOOL], -u->number); + l = min(u->number, get_effect(u, oldpotiontype[P_FOOL])); + a->data.i -= l * 30; + change_effect(u, oldpotiontype[P_FOOL], -l); } warrior_skill = fspecial(u->faction, FS_WARRIOR);