summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-08-07 21:13:07 +0300
committerAndrei Karas <akaras@inbox.ru>2015-08-10 23:06:08 +0300
commitc0367b69fd226be21643cd4b620fff2aadb0e742 (patch)
tree94b6cb16c7c5232020a22896496813be378a340e /src/map/pc.c
parent5ad96bcc2af2a5a76348fca87e52a0f038461808 (diff)
downloadhercules-c0367b69fd226be21643cd4b620fff2aadb0e742.tar.gz
hercules-c0367b69fd226be21643cd4b620fff2aadb0e742.tar.bz2
hercules-c0367b69fd226be21643cd4b620fff2aadb0e742.tar.xz
hercules-c0367b69fd226be21643cd4b620fff2aadb0e742.zip
Move use item script function call into function script_run_use_script.
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 5abf1050f..1589ae910 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4882,7 +4882,6 @@ int pc_isUseitem(struct map_session_data *sd,int n)
int pc_useitem(struct map_session_data *sd,int n) {
int64 tick = timer->gettick();
int amount, nameid, i;
- struct script_code *item_script;
nullpo_ret(sd);
@@ -4994,7 +4993,6 @@ int pc_useitem(struct map_session_data *sd,int n) {
sd->catch_target_class = -1;
amount = sd->status.inventory[n].amount;
- item_script = sd->inventory_data[n]->script;
//Check if the item is to be consumed immediately [Skotlex]
if (sd->inventory_data[n]->flag.delay_consume || sd->inventory_data[n]->flag.keepafteruse)
clif->useitemack(sd,n,amount,true);
@@ -5006,26 +5004,23 @@ int pc_useitem(struct map_session_data *sd,int n) {
clif->useitemack(sd, n, 0, false);
}
}
+
if(sd->status.inventory[n].card[0]==CARD0_CREATE &&
pc->famerank(MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3]), MAPID_ALCHEMIST))
{
- script->potion_flag = 2; // Famous player's potions have 50% more efficiency
- if (sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_ROGUE)
- script->potion_flag = 3; //Even more effective potions.
+ script->potion_flag = 2; // Famous player's potions have 50% more efficiency
+ if (sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_ROGUE)
+ script->potion_flag = 3; //Even more effective potions.
}
//Update item use time.
sd->canuseitem_tick = tick + battle_config.item_use_interval;
if( itemdb_iscashfood(nameid) )
sd->canusecashfood_tick = tick + battle_config.cashfood_use_interval;
-
- script->current_item_id = nameid;
-
- script->run(item_script,0,sd->bl.id,npc->fake_nd->bl.id);
-
- script->current_item_id = 0;
+
+ script->run_use_script(sd, sd->inventory_data[n], npc->fake_nd->bl.id);
+
script->potion_flag = 0;
-
return 1;
}