summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaruna <haru@dotalux.com>2015-08-12 16:16:28 +0200
committerHaruna <haru@dotalux.com>2015-08-12 16:16:28 +0200
commit8ce961b7bfa60f447d93b604a9944d9c44e8319c (patch)
treece60c77a7dadb8ff6de007032b33a051580d4cd0
parent10f24ba5b82e7e563cb720a8dea9a415fd8055d7 (diff)
parent691fe69c991503b2b00e4ece5d5cc956737e5a67 (diff)
downloadhercules-8ce961b7bfa60f447d93b604a9944d9c44e8319c.tar.gz
hercules-8ce961b7bfa60f447d93b604a9944d9c44e8319c.tar.bz2
hercules-8ce961b7bfa60f447d93b604a9944d9c44e8319c.tar.xz
hercules-8ce961b7bfa60f447d93b604a9944d9c44e8319c.zip
Merge pull request #636 from 4144/equippos
Add n parameter to function pc_equipitem_pos.
-rw-r--r--src/map/pc.c17
-rw-r--r--src/map/pc.h2
2 files changed, 16 insertions, 3 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index bc45f9184..ad32217b8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -9438,7 +9438,14 @@ int pc_load_combo(struct map_session_data *sd) {
return ret;
}
-void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int pos)
+/**
+* Equip item ad given position.
+* @param sd the affected player structure. Must be checked before.
+* @param id item structure for equip. Must be checked before.
+* @param n inventory item position. Must be checked before.
+* @param pos slot position. Must be checked before.
+**/
+void pc_equipitem_pos(struct map_session_data *sd, struct item_data *id, int n, int pos)
{
if (pos & (EQP_HAND_R|EQP_SHADOW_WEAPON)) {
if(id)
@@ -9612,7 +9619,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
sd->status.inventory[n].equip=pos;
- pc->equipitem_pos(sd, id, pos);
+ pc->equipitem_pos(sd, id, n, pos);
pc->checkallowskill(sd); //Check if status changes should be halted.
iflag = sd->npc_item_flag;
@@ -9660,6 +9667,12 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
return 1;
}
+/**
+* Unrquip item ad given position.
+* @param sd the affected player structure. Must be checked before.
+* @param n inventory item position. Must be checked before.
+* @param pos slot position. Must be checked before.
+**/
void pc_unequipitem_pos(struct map_session_data *sd, int n, int pos)
{
if (pos & EQP_HAND_R) {
diff --git a/src/map/pc.h b/src/map/pc.h
index f546d4910..d35c29bc7 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -915,7 +915,7 @@ END_ZEROED_BLOCK; /* End */
int (*resetfeel) (struct map_session_data *sd);
int (*resethate) (struct map_session_data *sd);
int (*equipitem) (struct map_session_data *sd,int n,int req_pos);
- void (*equipitem_pos) (struct map_session_data *sd, struct item_data *id, int pos);
+ void (*equipitem_pos) (struct map_session_data *sd, struct item_data *id, int n, int pos);
int (*unequipitem) (struct map_session_data *sd,int n,int flag);
void (*unequipitem_pos) (struct map_session_data *sd, int n, int pos);
int (*checkitem) (struct map_session_data *sd);