Skip to content

Commit

Permalink
Add n parameter to function pc_equipitem_pos.
Browse files Browse the repository at this point in the history
  • Loading branch information
4144 committed Aug 11, 2015
1 parent f9cc608 commit 691fe69
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/map/pc.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/map/pc.h
Expand Up @@ -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);
Expand Down

0 comments on commit 691fe69

Please sign in to comment.