From bff8a4273ec7cedd86b95055278be824ff566f98 Mon Sep 17 00:00:00 2001 From: ultramage Date: Tue, 3 Jul 2007 15:15:23 +0000 Subject: - 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 --- src/map/clif.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'src/map/clif.c') 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; -- cgit v1.2.3-70-g09d2