From c1af98341a057da28d80615f6bb325ef1d24e2d2 Mon Sep 17 00:00:00 2001 From: brianluau Date: Mon, 30 Jul 2012 09:15:12 +0000 Subject: - Removed redundant config after the Item Stacking System was added in r16279. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16535 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/Makefile.in | 2 +- src/map/skill.c | 29 +++++++++++++++++------------ 2 files changed, 18 insertions(+), 13 deletions(-) (limited to 'src/map') diff --git a/src/map/Makefile.in b/src/map/Makefile.in index a1f1bbd03..8e97221a7 100644 --- a/src/map/Makefile.in +++ b/src/map/Makefile.in @@ -27,7 +27,7 @@ MAP_H = map.h chrif.h clif.h pc.h status.h npc.h \ log.h mail.h date.h unit.h homunculus.h mercenary.h quest.h instance.h mapreg.h \ buyingstore.h searchstore.h duel.h pc_groups.h \ ../config/core.h ../config/renewal.h ../config/secure.h ../config/const.h \ - ../config/classes/general.h ../config/classes/swordsman.h elemental.h + ../config/classes/general.h elemental.h HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) diff --git a/src/map/skill.c b/src/map/skill.c index f93d5b772..1483919f0 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -15347,22 +15347,27 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in } if( skill_id == RK_RUNEMASTERY ) { int temp_qty, skill_lv = pc_checkskill(sd,skill_id); + data = itemdb_search(nameid); + if( skill_lv == 10 ) temp_qty = 1 + rnd()%3; else if( skill_lv > 5 ) temp_qty = 1 + rnd()%2; else temp_qty = 1; - for( i = 0; i < MAX_INVENTORY; i++ ) { - if( sd->status.inventory[i].nameid == nameid ) { - if( sd->status.inventory[i].amount >= MAX_RUNE ) { - clif_msgtable(sd->fd,0x61b); - return 0; - } else { - /** - * the amount fits, say we got temp_qty 4 and 19 runes, we trim temp_qty to 1. - **/ - if( temp_qty + sd->status.inventory[i].amount >= MAX_RUNE ) - temp_qty = MAX_RUNE - sd->status.inventory[i].amount; + + if (data->stack.inventory) { + for( i = 0; i < MAX_INVENTORY; i++ ) { + if( sd->status.inventory[i].nameid == nameid ) { + if( sd->status.inventory[i].amount >= data->stack.amount ) { + clif_msgtable(sd->fd,0x61b); + return 0; + } else { + /** + * the amount fits, say we got temp_qty 4 and 19 runes, we trim temp_qty to 1. + **/ + if( temp_qty + sd->status.inventory[i].amount >= data->stack.amount ) + temp_qty = data->stack.amount - sd->status.inventory[i].amount; + } + break; } - break; } } qty = temp_qty; -- cgit v1.2.3-60-g2f50