From 77ee0b7af7a53a966da868e8bc1e1a5fa5bf5ced Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 23 Jun 2014 19:17:13 -0700 Subject: [PATCH] remote the item_t enum for good --- src/kernel/battle.c | 2 +- src/kernel/item.c | 6 ------ src/kernel/item.h | 26 -------------------------- src/modules/arena.c | 2 +- 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/src/kernel/battle.c b/src/kernel/battle.c index bdd9d5226..db2a73cd4 100644 --- a/src/kernel/battle.c +++ b/src/kernel/battle.c @@ -836,7 +836,7 @@ static const armor_type *select_armor(troop t, bool shield) /* Hier ist zu beachten, ob und wie sich Zauber und Artefakte, die * Rüstungschutz geben, addieren. - * - Artefakt I_TROLLBELT gibt Rüstung +1 + * - Artefakt "trollbelt" gibt Rüstung +1 * - Zauber Rindenhaut gibt Rüstung +3 */ static int trollbelts(const unit *u) { diff --git a/src/kernel/item.c b/src/kernel/item.c index 2a06337d0..e0a72453b 100644 --- a/src/kernel/item.c +++ b/src/kernel/item.c @@ -593,9 +593,6 @@ give_money(unit * s, unit * d, const item_type * itype, int n, #define MAXHERBS MAX_HERBS #define MAXPOTIONS MAX_POTIONS #define MAXHERBSPERPOTION 6 -#define FIRSTLUXURY (I_BALM) -#define LASTLUXURY (I_INCENSE +1) -#define MAXLUXURIES (LASTLUXURY - FIRSTLUXURY) const potion_type *oldpotiontype[MAXPOTIONS + 1]; @@ -1237,7 +1234,4 @@ void register_resources(void) register_item_use(use_snowball, "usesnowball"); register_item_give(give_horses, "givehorses"); - - /* make sure noone has deleted an I_ tpe without deleting the R_ type that goes with it! */ - assert((int)I_TACTICCRYSTAL == (int)R_TACTICCRYSTAL); } diff --git a/src/kernel/item.h b/src/kernel/item.h index 5e56bb8bb..6e2427d6d 100644 --- a/src/kernel/item.h +++ b/src/kernel/item.h @@ -273,32 +273,6 @@ extern "C" { extern resource_type *r_permaura; extern resource_type *r_unit; - enum { - I_IRON, /* 0 */ - I_STONE, - I_HORSE, - /* alte Artefakte */ - I_AMULET_OF_HEALING, - I_AMULET_OF_TRUE_SEEING, - I_RING_OF_INVISIBILITY, - I_RING_OF_POWER, - I_CHASTITY_BELT, /* bleibt */ - I_LAEN, - I_FEENSTIEFEL, - I_BIRTHDAYAMULET, - I_PEGASUS, - I_ELVENHORSE, - I_DOLPHIN, - I_RING_OF_NIMBLEFINGER, - I_TROLLBELT, - I_AURAKULUM, - I_SPHERE_OF_INVISIBILITY, - I_BAG_OF_HOLDING, - I_SACK_OF_CONSERVATION, - I_TACTICCRYSTAL, - MAX_ITEMS /* do not use outside item.c ! */ - }; - typedef enum { /* ITEMS: */ R_IRON, diff --git a/src/modules/arena.c b/src/modules/arena.c index b2a7d6cc1..c15eb1227 100644 --- a/src/modules/arena.c +++ b/src/modules/arena.c @@ -370,7 +370,7 @@ static void guardian_faction(plane * pl, int id) continue; u = createunit(r, f, 1, new_race[RC_GOBLIN]); set_string(&u->name, "Igjarjuks Auge"); - set_item(u, I_RING_OF_INVISIBILITY, 1); + i_change(&u->items, it_find("roi"), 1); set_order(&u->thisorder, NULL); fset(u, UFL_ANON_FACTION); set_money(u, 1000);