From 28134ba1f33aea49a797f8e3be4aeaae80944231 Mon Sep 17 00:00:00 2001 From: Lance Date: Sun, 19 Mar 2006 04:36:53 +0000 Subject: * Recoded getmobdata script function. Fixed mob_damage typo sd -> mvp_sd. Cleanep up confusing indentation in clif.c. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5661 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 86 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 556a48f8d..07ea1598d 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9435,53 +9435,53 @@ void clif_parse_Wis(int fd, struct map_session_data *sd) { // S 0096 .w status.char_id, sd->status.account_id, (char*)mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, (char*)RFIFOP(fd, 4), (char*)RFIFOP(fd, 28)); -//-------------------------------------------------------// -// Lordalfa - Paperboy - To whisper NPC commands // -//-------------------------------------------------------// -if ((strncasecmp((const char*)RFIFOP(fd,4),"NPC:",4) == 0) && (strlen((const char*)RFIFOP(fd,4)) >4)) { - whisper_tmp = (char*) RFIFOP(fd,4) + 4; - if ((npc = npc_name2id(whisper_tmp))) - { - whisper_tmp=(char *)aCallocA(strlen((char *)(RFIFOP(fd,28)))+1,sizeof(char)); - whisper_tmp[0]=0; - - sprintf(whisper_tmp, "%s", (const char*)RFIFOP(fd,28)); - for( j=0;whisper_tmp[j]!='\0';j++) + //-------------------------------------------------------// + // Lordalfa - Paperboy - To whisper NPC commands // + //-------------------------------------------------------// + if ((strncasecmp((const char*)RFIFOP(fd,4),"NPC:",4) == 0) && (strlen((const char*)RFIFOP(fd,4)) >4)) { + whisper_tmp = (char*) RFIFOP(fd,4) + 4; + if ((npc = npc_name2id(whisper_tmp))) { - if(whisper_tmp[j]!='#') + whisper_tmp=(char *)aCallocA(strlen((char *)(RFIFOP(fd,28)))+1,sizeof(char)); + whisper_tmp[0]=0; + + sprintf(whisper_tmp, "%s", (const char*)RFIFOP(fd,28)); + for( j=0;whisper_tmp[j]!='\0';j++) { - split_data[i][j-k]=whisper_tmp[j]; - } - else + if(whisper_tmp[j]!='#') + { + split_data[i][j-k]=whisper_tmp[j]; + } + else + { + split_data[i][j-k]='\0'; + k=j+1; + i++; + } + } // Splits the message using '#' as separators + split_data[i][j-k]='\0'; + + aFree(whisper_tmp); + whisper_tmp=(char *)aCallocA(15,sizeof(char)); + whisper_tmp[0]=0; + + for (j=0;j<=10;j++) { - split_data[i][j-k]='\0'; - k=j+1; - i++; - } - } // Splits the message using '#' as separators - split_data[i][j-k]='\0'; - - aFree(whisper_tmp); - whisper_tmp=(char *)aCallocA(15,sizeof(char)); - whisper_tmp[0]=0; - - for (j=0;j<=10;j++) - { - sprintf(whisper_tmp, "@whispervar%d$", j); - set_var(sd,whisper_tmp,(char *) split_data[j]); - }//You don't need to zero them, just reset them [Kevin] - - aFree(whisper_tmp); - whisper_tmp=(char *)aCallocA(strlen(npc->name)+18,sizeof(char)); - whisper_tmp[0]=0; - - sprintf(whisper_tmp, "%s::OnWhisperGlobal", npc->name); - npc_event(sd,whisper_tmp,0); // Calls the NPC label + sprintf(whisper_tmp, "@whispervar%d$", j); + set_var(sd,whisper_tmp,(char *) split_data[j]); + }//You don't need to zero them, just reset them [Kevin] + + aFree(whisper_tmp); + whisper_tmp=(char *)aCallocA(strlen(npc->name)+18,sizeof(char)); + whisper_tmp[0]=0; + + sprintf(whisper_tmp, "%s::OnWhisperGlobal", npc->name); + npc_event(sd,whisper_tmp,0); // Calls the NPC label - aFree(whisper_tmp); //I rewrote it a little to use memory allocation, a bit more stable =P [Kevin] - return; - } //should have just removed the one below that was a my bad =P -} + aFree(whisper_tmp); //I rewrote it a little to use memory allocation, a bit more stable =P [Kevin] + return; + } //should have just removed the one below that was a my bad =P + } // Main chat [LuzZza] if(strcmpi((const char*)RFIFOP(fd,4), main_chat_nick) == 0) { -- cgit v1.2.3-60-g2f50