summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/itemdb.c10
-rw-r--r--src/map/itemdb.h1
-rw-r--r--src/map/skill.c7
3 files changed, 8 insertions, 10 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index b27074866..fcd6c804d 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -161,13 +161,9 @@ int itemdb_group_bonus(struct map_session_data* sd, int itemid)
for (i=0; i < MAX_ITEMGROUP; i++) {
if (!sd->itemgrouphealrate[i])
continue;
- for (j=0; j < itemgroup_db[i].qty; j++) {
- if (itemgroup_db[i].nameid[j] == itemid)
- {
- bonus += sd->itemgrouphealrate[i];
- break;
- }
- }
+ ARR_FIND( 0, itemgroup_db[i].qty, j, itemgroup_db[i].nameid[j] == itemid );
+ if( j < itemgroup_db[i].qty )
+ bonus += sd->itemgrouphealrate[i];
}
return bonus;
}
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 507478196..865ceaf9d 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -36,6 +36,7 @@ enum item_types {
//The only item group required by the code to be known. See const.txt for the full list.
#define IG_FINDINGORE 6
+#define IG_POTION 37
//The max. item group count (increase this when needed).
#define MAX_ITEMGROUP 40
diff --git a/src/map/skill.c b/src/map/skill.c
index 33368da97..fe2fff2a5 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4082,10 +4082,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
sp = sp * (100 + pc_checkskill(dstsd,MG_SRECOVERY)*10) / 100;
}
}
- if (sd->itemgrouphealrate[37]>0)
+
+ if (sd->itemgrouphealrate[IG_POTION]>0)
{
- hp += hp * sd->itemgrouphealrate[37] / 100;
- sp += sp * sd->itemgrouphealrate[37] / 100;
+ hp += hp * sd->itemgrouphealrate[IG_POTION] / 100;
+ sp += sp * sd->itemgrouphealrate[IG_POTION] / 100;
}
if ((i = pc_skillheal_bonus(sd, skillid)))