summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-10 16:57:34 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-10 16:57:34 +0000
commit1a26dbddc283e94bdfb684a71b0d9db471e18b3b (patch)
treea2981f34f29d67570b7a24daedd2aac5bbfbbeef /src/map/pc.c
parent14bdff735de758412712d0c36af2d4a723752dbc (diff)
downloadhercules-1a26dbddc283e94bdfb684a71b0d9db471e18b3b.tar.gz
hercules-1a26dbddc283e94bdfb684a71b0d9db471e18b3b.tar.bz2
hercules-1a26dbddc283e94bdfb684a71b0d9db471e18b3b.tar.xz
hercules-1a26dbddc283e94bdfb684a71b0d9db471e18b3b.zip
- 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
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c18
1 files changed, 15 insertions, 3 deletions
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;i<EQI_MAX;i++) {
+ if (pos&EQP_HAND_R && battle_config.use_weapon_skill_range)
+ { //Update skill-block range database when weapon range changes. [Skotlex]
+ i = sd->equip_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;i<EQI_MAX;i++) {
if(pos & equip_pos[i]) {
if(sd->equip_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;