diff --git a/src/common/gamecode/economy.c b/src/common/gamecode/economy.c index 24f855e41..8dc1af14b 100644 --- a/src/common/gamecode/economy.c +++ b/src/common/gamecode/economy.c @@ -562,7 +562,7 @@ TODO: Einen Trigger benutzen! } add_give(src, dest, n, item2resource(itype), cmd, error); if (error) return -1; - return; + return 0; } void @@ -925,8 +925,8 @@ dogive(region * r, unit * u, strlist * S, boolean liefere, int mode) while (*itmp) { const herb_type * htype = resource2herb((*itmp)->type->rtype); if (htype && (*itmp)->number>0) { + if (give_item((*itmp)->number, (*itmp)->type, u, u2, S->s)==0) continue; n = 1; - if (give_item((*itmp)->number, (*itmp)->type, u, u2, S->s)!=0) break; } itmp = &(*itmp)->next; } @@ -974,7 +974,7 @@ dogive(region * r, unit * u, strlist * S, boolean liefere, int mode) if ((*itmp)->number > 0 && (*itmp)->number - new_get_resvalue(u, (*itmp)->type->rtype) > 0) { 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; } diff --git a/src/common/kernel/unit.c b/src/common/kernel/unit.c index cb26a66f1..a4703f89a 100644 --- a/src/common/kernel/unit.c +++ b/src/common/kernel/unit.c @@ -737,7 +737,7 @@ transfermen(unit * u, unit * u2, int n) a = a_find(u->attribs, &at_effect); while (a) { 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; } if (fval(u, FL_LONGACTION)) fset(u2, FL_LONGACTION);