diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-03-20 20:19:23 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-03-20 20:19:23 +0000 |
commit | 1a18fb9893df4d3cb40910d41acf875c7c6ea773 (patch) | |
tree | edff894a35b9019f85be7890bcf3ab12d216244e /src/map/clif.c | |
parent | d6d6653b47488b9ad96b153d546639d52bcc0aba (diff) | |
download | hercules-1a18fb9893df4d3cb40910d41acf875c7c6ea773.tar.gz hercules-1a18fb9893df4d3cb40910d41acf875c7c6ea773.tar.bz2 hercules-1a18fb9893df4d3cb40910d41acf875c7c6ea773.tar.xz hercules-1a18fb9893df4d3cb40910d41acf875c7c6ea773.zip |
* Random accumulated tweaks and fixes.
- Added a error message to npc_enable, to spot disablenpc/enablenpc/hideoffnpc/hideonnpc on non-existing NPCs (related r14750).
- Replaced inlined npc_name2id code with calls to npc_name2id.
- Open Buying Store skill is now exempted from noskill mapflag like Vending as well (bugreport:4815, follow up to r14713).
- Fixed signed constant being returned as unsigned value in get_percentage (bugreport:4765, since r12679).
- Replaced strlen checks, which checked whether or not a string is empty, with first-byte checks.
- Fixed enabling 'fakename' not clearing party and guild name and cleaned up atcommand 'fakename' code.
- Cleaned up party/guild name code in clif_charnameack (follow up to r14737).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14751 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 40e6d9b71..29404a373 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7624,7 +7624,9 @@ int clif_refresh(struct map_session_data *sd) return 0; } -// updates the object's (bl) name on client +/// Updates the object's (bl) name on client (ZC_ACK_REQNAME/ZC_ACK_REQNAMEALL) +/// 0095 <unit id>.L <char name>.24B +/// 0195 <unit id>.L <char name>.24B <party name>.24B <guild name>.24B <position name>.24B int clif_charnameack (int fd, struct block_list *bl) { unsigned char buf[103]; @@ -7647,24 +7649,31 @@ int clif_charnameack (int fd, struct block_list *bl) if (ssd->fd == fd && ssd->disguise) WBUFL(buf,2) = -bl->id; - if (strlen(ssd->fakename)>1) { + if( ssd->fakename[0] ) + { + WBUFW(buf, 0) = cmd = 0x195; memcpy(WBUFP(buf,6), ssd->fakename, NAME_LENGTH); + WBUFB(buf,30) = WBUFB(buf,54) = WBUFB(buf,78) = 0; break; } memcpy(WBUFP(buf,6), ssd->status.name, NAME_LENGTH); - - if (!battle_config.display_party_name) { - if (ssd->status.party_id > 0 && ssd->status.guild_id > 0 && (g = guild_search(ssd->status.guild_id)) != NULL) - p = party_search(ssd->status.party_id); - }else{ - if (ssd->status.party_id > 0) - p = party_search(ssd->status.party_id); - } - if( ssd->status.guild_id > 0 && (g = guild_search(ssd->status.guild_id)) != NULL ) + if( ssd->status.party_id ) + { + p = party_search(ssd->status.party_id); + } + if( ssd->status.guild_id ) { - ARR_FIND(0, g->max_member, i, g->member[i].account_id == ssd->status.account_id && g->member[i].char_id == ssd->status.char_id); - if( i < g->max_member ) ps = g->member[i].position; + if( ( g = guild_search(ssd->status.guild_id) ) != NULL ) + { + ARR_FIND(0, g->max_member, i, g->member[i].account_id == ssd->status.account_id && g->member[i].char_id == ssd->status.char_id); + if( i < g->max_member ) ps = g->member[i].position; + } + } + + if( !battle_config.display_party_name && g == NULL ) + {// do not display party unless the player is also in a guild + p = NULL; } if (p == NULL && g == NULL) @@ -7766,7 +7775,7 @@ int clif_charnameupdate (struct map_session_data *ssd) nullpo_ret(ssd); - if (strlen(ssd->fakename)>1) + if( ssd->fakename[0] ) return 0; //No need to update as the party/guild was not displayed anyway. WBUFW(buf,0) = cmd; |