From a28cbc647a40c1c9a42a7c1e61e80dffef3dfea9 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 9 Nov 2014 14:39:48 +0100 Subject: [PATCH] loot refactoring and a small armor/shield fix. --- src/battle.c | 15 +++------------ src/report.c | 2 +- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/battle.c b/src/battle.c index a5e553f2e..3f33381f4 100644 --- a/src/battle.c +++ b/src/battle.c @@ -1059,8 +1059,8 @@ terminate(troop dt, troop at, int type, const char *damage, bool missile) int hp; int ar = 0, an, am; - const armor_type *armor = select_armor(dt, true); - const armor_type *shield = select_armor(dt, false); + const armor_type *armor = select_armor(dt, false); + const armor_type *shield = select_armor(dt, true); const weapon_type *dwtype = NULL; const weapon_type *awtype = NULL; @@ -2554,16 +2554,7 @@ static void loot_items(fighter * corpse) mustloot ? loot : loot_quota(corpse->unit, fig->unit, itm->type, loot); if (trueloot > 0) { - item *l = fig->loot; - while (l && l->type != itm->type) - l = l->next; - if (!l) { - l = calloc(sizeof(item), 1); - l->next = fig->loot; - fig->loot = l; - l->type = itm->type; - } - l->number += trueloot; + i_change(&fig->loot, itm->type, trueloot); } } } diff --git a/src/report.c b/src/report.c index 0b41598d4..4b2765158 100644 --- a/src/report.c +++ b/src/report.c @@ -1418,7 +1418,7 @@ static void durchreisende(FILE * F, const region * r, const faction * f) if (cansee_durchgezogen(f, r, u, 0)) { ++counter; if (u->ship != NULL) { -#ifdef GERMAN_FLUFF_DISABLED +#ifdef GERMAN_FLUFF_ENABLED if (counter == 1) { bytes = (int)strlcpy(bufp, "Die ", size); }