fix negative tranktwirkungen

This commit is contained in:
Katja Zedel 2001-02-04 07:52:30 +00:00
parent a7f94f3a39
commit 63d8c3830a
1 changed files with 8 additions and 6 deletions

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* 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 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -324,7 +324,7 @@ learn(void)
unit *u; unit *u;
int p; int p;
magic_t mtyp; magic_t mtyp;
int i; int i, l;
int warrior_skill; int warrior_skill;
int studycost; int studycost;
@ -485,12 +485,14 @@ learn(void)
} }
if (get_effect(u, oldpotiontype[P_WISE])) { if (get_effect(u, oldpotiontype[P_WISE])) {
a->data.i += min(u->number, get_effect(u, oldpotiontype[P_WISE])) * 10; l = min(u->number, get_effect(u, oldpotiontype[P_WISE]));
change_effect(u, oldpotiontype[P_WISE], -u->number); a->data.i += l * 10;
change_effect(u, oldpotiontype[P_WISE], -l);
} }
if (get_effect(u, oldpotiontype[P_FOOL])) { /* Trank "Dumpfbackenbrot" */ if (get_effect(u, oldpotiontype[P_FOOL])) { /* Trank "Dumpfbackenbrot" */
a->data.i -= min(u->number, get_effect(u, oldpotiontype[P_FOOL])) * 30; l = min(u->number, get_effect(u, oldpotiontype[P_FOOL]));
change_effect(u, oldpotiontype[P_FOOL], -u->number); a->data.i -= l * 30;
change_effect(u, oldpotiontype[P_FOOL], -l);
} }
warrior_skill = fspecial(u->faction, FS_WARRIOR); warrior_skill = fspecial(u->faction, FS_WARRIOR);