summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-07-03 15:15:23 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-07-03 15:15:23 +0000
commitbff8a4273ec7cedd86b95055278be824ff566f98 (patch)
treeade51d50184bbcc361b3cc0ba4e86d0d398946e0 /src/map/clif.c
parentf0b6539b1f935f0c05ed3d6543abb604659418d7 (diff)
downloadhercules-bff8a4273ec7cedd86b95055278be824ff566f98.tar.gz
hercules-bff8a4273ec7cedd86b95055278be824ff566f98.tar.bz2
hercules-bff8a4273ec7cedd86b95055278be824ff566f98.tar.xz
hercules-bff8a4273ec7cedd86b95055278be824ff566f98.zip
- Re-coded 'soundeffectall'; removed the third parameter ('coverage')
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10844 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index b501d76d4..e7bab9ebc 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7347,42 +7347,36 @@ int clif_wisall(struct map_session_data *sd,int type,int flag)
/*==========================================
* サウンドエフェクト
*------------------------------------------*/
-void clif_soundeffect(struct map_session_data *sd,struct block_list *bl,const char *name,int type)
+void clif_soundeffect(struct map_session_data* sd, struct block_list* bl, const char* name, int type)
{
int fd;
nullpo_retv(sd);
nullpo_retv(bl);
- fd=sd->fd;
+ fd = sd->fd;
WFIFOHEAD(fd,packet_len(0x1d3));
- WFIFOW(fd,0)=0x1d3;
- memcpy(WFIFOP(fd,2),name,NAME_LENGTH);
- WFIFOB(fd,26)=type;
- WFIFOL(fd,27)=0;
- WFIFOL(fd,31)=bl->id;
+ WFIFOW(fd,0) = 0x1d3;
+ safestrncpy((char*)WFIFOP(fd,2), name, NAME_LENGTH);
+ WFIFOB(fd,26) = type;
+ WFIFOL(fd,27) = 0;
+ WFIFOL(fd,31) = bl->id;
WFIFOSET(fd,packet_len(0x1d3));
return;
}
-int clif_soundeffectall(struct block_list *bl, const char *name, int type, int coverage)
+int clif_soundeffectall(struct block_list* bl, const char* name, int type, enum send_target coverage)
{
unsigned char buf[40];
- memset(buf, 0, packet_len(0x1d3));
-
- if(coverage < 0 || coverage > 22){
- ShowError("clif_soundeffectall: undefined coverage.\n");
- return 0;
- }
nullpo_retr(0, bl);
- WBUFW(buf,0)=0x1d3;
- memcpy(WBUFP(buf,2), name, NAME_LENGTH);
- WBUFB(buf,26)=type;
- WBUFL(buf,27)=0;
- WBUFL(buf,31)=bl->id;
+ WBUFW(buf,0) = 0x1d3;
+ safestrncpy((char*)WBUFP(buf,2), name, NAME_LENGTH);
+ WBUFB(buf,26) = type;
+ WBUFL(buf,27) = 0;
+ WBUFL(buf,31) = bl->id;
clif_send(buf, packet_len(0x1d3), bl, coverage);
return 0;