Skip to content

Commit

Permalink
Fixed #1391
Browse files Browse the repository at this point in the history
Signed-off-by: Cydh Ramdh <cydh@pservero.com>
  • Loading branch information
cydh committed Aug 2, 2016
1 parent 11a8425 commit 0647b15
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
30 changes: 28 additions & 2 deletions src/map/clif.c
Expand Up @@ -5820,7 +5820,7 @@ void clif_cooking_list(struct map_session_data *sd, int trigger, uint16 skill_id
/// 0196 <index>.W <id>.L <state>.B (ZC_MSG_STATE_CHANGE) [used for ending status changes and starting them on non-pc units (when needed)]
/// 043f <index>.W <id>.L <state>.B <remain msec>.L { <val>.L }*3 (ZC_MSG_STATE_CHANGE2) [used exclusively for starting statuses on pcs]
/// 0983 <index>.W <id>.L <state>.B <total msec>.L <remain msec>.L { <val>.L }*3 (ZC_MSG_STATE_CHANGE3) (PACKETVER >= 20120618)
void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3)
void clif_status_change_sub(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3, enum send_target target_type)
{
unsigned char buf[32];
struct map_session_data *sd;
Expand Down Expand Up @@ -5872,7 +5872,26 @@ void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val
WBUFL(buf,21) = val3;
}
#endif
clif_send(buf,packet_len(WBUFW(buf,0)),bl, (sd && sd->status.option&OPTION_INVISIBLE) ? SELF : AREA);
clif_send(buf,packet_len(WBUFW(buf,0)),bl, target_type);
}

void clif_status_change(struct block_list *bl,int type,int flag,int tick,int val1, int val2, int val3) {
struct map_session_data *sd;

if (type == SI_BLANK) //It shows nothing on the client...
return;

if (type == SI_ACTIONDELAY && tick == 0)
return;

nullpo_retv(bl);

sd = BL_CAST(BL_PC, bl);

if (!(status_type2relevant_bl_types(type)&bl->type)) // only send status changes that actually matter to the client
return;

clif_status_change_sub(bl,type, flag, tick, val1, val2, val3, (sd && sd->status.option&OPTION_INVISIBLE) ? SELF : AREA);
}

/**
Expand Down Expand Up @@ -5901,7 +5920,14 @@ void clif_efst_status_change_sub(struct map_session_data *sd, struct block_list

if (td)
tick = DIFF_TICK(td->tick, gettick());
#if PACKETVER > 20120418
clif_efst_status_change((target == SELF) ? &sd->bl : bl, bl->id, target, StatusIconChangeTable[type], tick, tsd->sc_display[i]->val1, tsd->sc_display[i]->val2, tsd->sc_display[i]->val3);
#else
/** !CHECKME: Corrected packet for this client for clif_efst_status_change.
* The packet sent by clif_status_change_sub only works only the char with the effect sends the effect detail.
**/
clif_status_change_sub(&tsd->bl, StatusIconChangeTable[type], 1, tick, tsd->sc_display[i]->val1, tsd->sc_display[i]->val2, tsd->sc_display[i]->val3, (target == SELF) ? AREA_WOS : AREA);
#endif
}
}

Expand Down
10 changes: 7 additions & 3 deletions src/map/pc.c
Expand Up @@ -8678,9 +8678,11 @@ void pc_setoption(struct map_session_data *sd,int type)
clif_skillinfoblock(sd); // Skill list needs to be updated after base change.
}

/*==========================================
/**
* Give player a cart
*------------------------------------------*/
* @param sd Player
* @param type 0:Remove cart, 1 ~ MAX_CARTS: Cart type
**/
bool pc_setcart(struct map_session_data *sd,int type) {
#ifndef NEW_CARTS
int cart[6] = {0x0000,OPTION_CART1,OPTION_CART2,OPTION_CART3,OPTION_CART4,OPTION_CART5};
Expand All @@ -8707,10 +8709,12 @@ bool pc_setcart(struct map_session_data *sd,int type) {
if( !sd->sc.data[SC_PUSH_CART] ) /* first time, so fill cart data */
clif_cartlist(sd);
clif_updatestatus(sd, SP_CARTINFO);
sc_start(&sd->bl,&sd->bl, SC_PUSH_CART, 100, type, 0);
sc_start(&sd->bl,&sd->bl, SC_PUSH_CART, 100, type, -1);
#if PACKETVER > 20120418
clif_efst_status_change(&sd->bl, sd->bl.id, AREA, SI_ON_PUSH_CART, 9999, type, 0, 0);
if( sd->sc.data[SC_PUSH_CART] )/* forcefully update */
sd->sc.data[SC_PUSH_CART]->val1 = type;
#endif
break;
}

Expand Down
1 change: 1 addition & 0 deletions src/map/status.c
Expand Up @@ -10572,6 +10572,7 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
case SC_JEXPBOOST:
case SC_ITEMBOOST:
case SC_JP_EVENT04:
case SC_PUSH_CART:
val_flag |= 1;
break;
// Start |1|2 val_flag setting
Expand Down

0 comments on commit 0647b15

Please sign in to comment.