From 65ee11a599f904bdece45c55dd41eb2633da575f Mon Sep 17 00:00:00 2001 From: ultramage Date: Sat, 4 Aug 2007 15:31:02 +0000 Subject: * Removed weird mvp reward item drop behavior (see topic:160077) * Fixed Cart Revolution not transferring status effects on attack, and Cart Termination doing it when it shouldn't (see topic:156745) * Fixed #refine not accepting names with spaces in them * Fixed disguises not doing sit-down properly (missing self packet), broken since r6299 stable / r5833 trunk * Added missing /blackmith packet action to packet_db.txt * Removed "eathena's custom equipped mobs" from mob&skill db git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10946 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/charcommand.c | 2 +- src/map/clif.c | 38 ++++++++++++++++++++++++-------------- src/map/clif.h | 4 ++-- src/map/mob.c | 4 +--- src/map/skill.c | 2 +- src/map/status.c | 2 +- 6 files changed, 30 insertions(+), 22 deletions(-) (limited to 'src/map') diff --git a/src/map/charcommand.c b/src/map/charcommand.c index 7f0f9b089..bfd41f346 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -2381,7 +2381,7 @@ int charcommand_refine(const int fd, struct map_session_data* sd, const char* co char output[200]; struct map_session_data *pl_sd; - if (!message || !*message || sscanf(message, "%d %d %s", &position, &refine, character) < 3) { + if (!message || !*message || sscanf(message, "%d %d %23[^\n]", &position, &refine, character) < 3) { clif_displaymessage(fd, "Please, enter a position and a amount (usage: #refine <+/- amount> )."); sprintf(output, "%d: Left Accessory", EQI_ACC_L); clif_displaymessage(fd, output); diff --git a/src/map/clif.c b/src/map/clif.c index 792862f85..216116bbd 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -90,7 +90,7 @@ struct packet_db_t packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB + 1]; #define clif_trading(sd) (sd->npc_id || sd->vender_id || sd->state.trading ) //To idenfity disguised characters. -#define disguised(bl) (bl->type==BL_PC && ((TBL_PC*)bl)->disguise) +#define disguised(bl) ((bl)->type==BL_PC && ((TBL_PC*)bl)->disguise) //Guarantees that the given string does not exceeds the allowed size, as well as making sure it's null terminated. [Skotlex\] #define mes_len_check(mes, len, max) if (len > max) { mes[max-1] = '\0'; len = max; } else mes[len-1] = '\0'; @@ -7220,9 +7220,9 @@ void clif_parse_ReqMarriage(int fd, struct map_session_data *sd) } /*========================================== - * inform target(s) that `sd` is sitting + * inform clients in area that `sd` is sitting *------------------------------------------*/ -void clif_sitting(struct map_session_data* sd, enum send_target target) +void clif_sitting(struct map_session_data* sd) { unsigned char buf[32]; @@ -7231,13 +7231,18 @@ void clif_sitting(struct map_session_data* sd, enum send_target target) WBUFW(buf, 0) = 0x8a; WBUFL(buf, 2) = sd->bl.id; WBUFB(buf,26) = 2; - clif_send(buf, packet_len(0x8a), &sd->bl, target); + clif_send(buf, packet_len(0x8a), &sd->bl, AREA); + + if(disguised(&sd->bl)) { + WBUFL(buf, 2) = -sd->bl.id; + clif_send(buf, packet_len(0x8a), &sd->bl, SELF); + } } /*========================================== - * inform target(s) that `sd` is standing + * inform clients in area that `sd` is standing *------------------------------------------*/ -void clif_standing(struct map_session_data* sd, enum send_target target) +void clif_standing(struct map_session_data* sd) { unsigned char buf[32]; @@ -7246,7 +7251,12 @@ void clif_standing(struct map_session_data* sd, enum send_target target) WBUFW(buf, 0) = 0x8a; WBUFL(buf, 2) = sd->bl.id; WBUFB(buf,26) = 3; - clif_send(buf, packet_len(0x8a), &sd->bl, target); + clif_send(buf, packet_len(0x8a), &sd->bl, AREA); + + if(disguised(&sd->bl)) { + WBUFL(buf, 2) = -sd->bl.id; + clif_send(buf, packet_len(0x8a), &sd->bl, SELF); + } } /*========================================== @@ -8679,9 +8689,10 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, clif_skill_fail(sd, 1, 0, 2); break; } + if(pc_issit(sd)) { //Bugged client? Just refresh them. - clif_sitting(sd, SELF); + clif_sitting(sd); return; } @@ -8694,18 +8705,18 @@ void clif_parse_ActionRequest_sub(struct map_session_data *sd, int action_type, )) //No sitting during these states neither. break; pc_setsit(sd); - skill_sit(sd, 1); - clif_sitting(sd, AREA); + skill_sit(sd,1); + clif_sitting(sd); break; case 0x03: // standup if (!pc_issit(sd)) { //Bugged client? Just refresh them. - clif_standing(sd, SELF); + clif_standing(sd); return; } pc_setstand(sd); - skill_sit(sd, 0); - clif_standing(sd, AREA); + skill_sit(sd,0); + clif_standing(sd); break; } } @@ -11390,7 +11401,6 @@ void clif_parse_AdoptRequest(int fd,struct map_session_data *sd) } } - /*========================================== * Homunculus packets *------------------------------------------*/ diff --git a/src/map/clif.h b/src/map/clif.h index 4f35818cc..90ead35fa 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -132,8 +132,8 @@ int clif_fame_blacksmith(struct map_session_data *, int); int clif_fame_alchemist(struct map_session_data *, int); int clif_fame_taekwon(struct map_session_data *, int); -void clif_sitting(struct map_session_data* sd, enum send_target target); -void clif_standing(struct map_session_data* sd, enum send_target target); +void clif_sitting(struct map_session_data* sd); +void clif_standing(struct map_session_data* sd); void clif_emotion(struct block_list *bl,int type); void clif_talkiebox(struct block_list* bl, const char* talkie); void clif_wedding_effect(struct block_list *bl); diff --git a/src/map/mob.c b/src/map/mob.c index 222f0130a..60c5ad603 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2099,9 +2099,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) intif_GMmessage(message,strlen(message)+1,0); } - if((temp = mvp_sd->weight*2 > mvp_sd->max_weight)) - map_addflooritem(&item,1,mvp_sd->bl.m,mvp_sd->bl.x,mvp_sd->bl.y,mvp_sd,second_sd,third_sd,1); - else if((temp = pc_additem(mvp_sd,&item,1))) { + if((temp = pc_additem(mvp_sd,&item,1)) != 0) { clif_additem(sd,0,0,temp); map_addflooritem(&item,1,mvp_sd->bl.m,mvp_sd->bl.x,mvp_sd->bl.y,mvp_sd,second_sd,third_sd,1); } diff --git a/src/map/skill.c b/src/map/skill.c index bf6e84d8c..500df9aec 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1373,7 +1373,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int } if(sd && attack_type&BF_WEAPON && - skillid != MC_CARTREVOLUTION && + skillid != WS_CARTTERMINATION && skillid != AM_DEMONSTRATION && skillid != CR_REFLECTSHIELD ){ //Trigger status effects diff --git a/src/map/status.c b/src/map/status.c index 9bf6861c9..59212b1d5 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -5324,7 +5324,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val case SC_TENSIONRELAX: if (sd) { pc_setsit(sd); - clif_sitting(sd, AREA); + clif_sitting(sd); } val2 = 12; //SP cost val4 = 10000; //Decrease at 10secs intervals. -- cgit v1.2.3-60-g2f50