Bugfix GIB ALLES (nochmal)

Bugfix potion-effects ohne value
This commit is contained in:
Enno Rehling 2002-07-28 10:32:40 +00:00
parent 4e4ad9b77c
commit ca86009d82
2 changed files with 4 additions and 4 deletions

View File

@ -562,7 +562,7 @@ TODO: Einen Trigger benutzen!
} }
add_give(src, dest, n, item2resource(itype), cmd, error); add_give(src, dest, n, item2resource(itype), cmd, error);
if (error) return -1; if (error) return -1;
return; return 0;
} }
void void
@ -925,8 +925,8 @@ dogive(region * r, unit * u, strlist * S, boolean liefere, int mode)
while (*itmp) { while (*itmp) {
const herb_type * htype = resource2herb((*itmp)->type->rtype); const herb_type * htype = resource2herb((*itmp)->type->rtype);
if (htype && (*itmp)->number>0) { if (htype && (*itmp)->number>0) {
if (give_item((*itmp)->number, (*itmp)->type, u, u2, S->s)==0) continue;
n = 1; n = 1;
if (give_item((*itmp)->number, (*itmp)->type, u, u2, S->s)!=0) break;
} }
itmp = &(*itmp)->next; itmp = &(*itmp)->next;
} }
@ -974,7 +974,7 @@ dogive(region * r, unit * u, strlist * S, boolean liefere, int mode)
if ((*itmp)->number > 0 if ((*itmp)->number > 0
&& (*itmp)->number - new_get_resvalue(u, (*itmp)->type->rtype) > 0) { && (*itmp)->number - new_get_resvalue(u, (*itmp)->type->rtype) > 0) {
n = (*itmp)->number - new_get_resvalue(u, (*itmp)->type->rtype); n = (*itmp)->number - new_get_resvalue(u, (*itmp)->type->rtype);
if (give_item(n, (*itmp)->type, u, u2, S->s)!=0) break; if (give_item(n, (*itmp)->type, u, u2, S->s)==0) continue;
} }
itmp = &(*itmp)->next; itmp = &(*itmp)->next;
} }

View File

@ -737,7 +737,7 @@ transfermen(unit * u, unit * u2, int n)
a = a_find(u->attribs, &at_effect); a = a_find(u->attribs, &at_effect);
while (a) { while (a) {
effect_data * olde = (effect_data*)a->data.v; effect_data * olde = (effect_data*)a->data.v;
change_effect(u2, olde->type, olde->value); if (olde->value) change_effect(u2, olde->type, olde->value);
a = a->nexttype; a = a->nexttype;
} }
if (fval(u, FL_LONGACTION)) fset(u2, FL_LONGACTION); if (fval(u, FL_LONGACTION)) fset(u2, FL_LONGACTION);