From 1a26dbddc283e94bdfb684a71b0d9db471e18b3b Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 10 Jul 2006 16:57:34 +0000 Subject: - Added a check in pc_equipitem so that when switching weapons and you have the skill_range_by_weapon setting active, the skill info block (which includes range) will be resent when the new weapon to equip has a range different than the previous one. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7599 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 4 ++++ src/map/pc.c | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 9a0a2e797..24cbb3014 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/07/10 + * Added a check in pc_equipitem so that when switching weapons and you have + the skill_range_by_weapon setting active, the skill info block (which + includes range) will be resent when the new weapon to equip has a range + different than the previous one. [Skotlex] * One closer inspection, removed that clear in itemdb_reload for a foreach call again. And modified itemdb_load to scrap the dummy item entry from the item_db and replace it with proper data for the item. [Skotlex] diff --git a/src/map/pc.c b/src/map/pc.c index 3fcb2ee41..d79ca7319 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6109,7 +6109,7 @@ int pc_cleareventtimer(struct map_session_data *sd) */ int pc_equipitem(struct map_session_data *sd,int n,int req_pos) { - int i,pos; + int i,pos,flag=0; struct item_data *id; nullpo_retr(0, sd); @@ -6130,7 +6130,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos) clif_equipitemack(sd,n,0,0); // fail return 0; } - + if(pos == EQP_ACC) { //Accesories should only go in one of the two, pos = req_pos&EQP_ACC; if (pos == EQP_ACC) //User specified both slots.. @@ -6146,8 +6146,17 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos) pos = sd->equip_index[EQI_HAND_R] >= 0 ? EQP_HAND_L : EQP_HAND_R; } - for(i=0;iequip_index[EQI_HAND_R]; + if (i < 0 || !sd->inventory_data[i]) //No data, or no weapon equipped + flag = 1; + else + flag = id->range != sd->inventory_data[i]->range; + } + + for(i=0;iequip_index[i] >= 0) //Slot taken, remove item from there. pc_unequipitem(sd,sd->equip_index[i],2); @@ -6229,6 +6238,9 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos) } */ status_calc_pc(sd,0); + if (flag) //Update skill data + clif_skillinfoblock(sd); + //OnEquip script [Skotlex] if (sd->inventory_data[n]) { int i; -- cgit v1.2.3-70-g09d2