From 400c6a2e625197f70326587401b13ab02659682f Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 11 Mar 2014 02:58:45 +0100 Subject: Fixed some warnings (unused functions) pointed out by clang-5.1. Signed-off-by: Haru --- src/map/clif.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index c61a72597..1c5f7e003 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -99,17 +99,16 @@ static inline void WBUFPOS2(uint8* p, unsigned short pos, short x0, short y0, sh p[5] = (uint8)((sx0<<4) | (sy0&0x0f)); } - +#if 0 // Currently unused static inline void WFIFOPOS(int fd, unsigned short pos, short x, short y, unsigned char dir) { WBUFPOS(WFIFOP(fd,pos), 0, x, y, dir); } - +#endif // 0 static inline void WFIFOPOS2(int fd, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0) { WBUFPOS2(WFIFOP(fd,pos), 0, x0, y0, x1, y1, sx0, sy0); } - static inline void RBUFPOS(const uint8* p, unsigned short pos, short* x, short* y, unsigned char* dir) { p += pos; @@ -126,7 +125,11 @@ static inline void RBUFPOS(const uint8* p, unsigned short pos, short* x, short* } } +static inline void RFIFOPOS(int fd, unsigned short pos, short* x, short* y, unsigned char* dir) { + RBUFPOS(RFIFOP(fd,pos), 0, x, y, dir); +} +#if 0 // currently unused static inline void RBUFPOS2(const uint8* p, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0) { p += pos; @@ -154,19 +157,12 @@ static inline void RBUFPOS2(const uint8* p, unsigned short pos, short* x0, short sy0[0] = ( p[5] & 0x0f ) >> 0; } } - - -static inline void RFIFOPOS(int fd, unsigned short pos, short* x, short* y, unsigned char* dir) { - RBUFPOS(RFIFOP(fd,pos), 0, x, y, dir); -} - - static inline void RFIFOPOS2(int fd, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0) { RBUFPOS2(WFIFOP(fd,pos), 0, x0, y0, x1, y1, sx0, sy0); } +#endif // 0 - -//To idenfity disguised characters. +//To identify disguised characters. static inline bool disguised(struct block_list* bl) { return (bool)( bl->type == BL_PC && ((TBL_PC*)bl)->disguise != -1 ); } -- cgit v1.2.3-70-g09d2 From 44819f75ab08b78ed7d09d3bbae0dc78a63aca52 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Tue, 11 Mar 2014 16:32:50 -0300 Subject: Fixed Bug 8072 Special Thanks to kyeme, Haruna http://hercules.ws/board/tracker/issue-8072-map-crash-autotrade/ Signed-off-by: shennetsind --- src/map/clif.c | 6 +++--- src/map/pc.c | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 1c5f7e003..cf6257628 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9927,13 +9927,13 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data* sd) } WFIFOSET(fd, WFIFOW(fd,2)); + // Chat logging type 'O' / Global Chat + logs->chat(LOG_CHAT_GLOBAL, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); + #ifdef PCRE_SUPPORT // trigger listening npcs map->foreachinrange(npc_chat->sub, &sd->bl, AREA_SIZE, BL_NPC, text, textlen, &sd->bl); #endif - - // Chat logging type 'O' / Global Chat - logs->chat(LOG_CHAT_GLOBAL, 0, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, message); } diff --git a/src/map/pc.c b/src/map/pc.c index 87f14bcd9..5eb682415 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -10477,6 +10477,12 @@ void pc_autotrade_prepare(struct map_session_data *sd) { sex = sd->status.sex; safestrncpy(title, sd->message, sizeof(title)); + sd->npc_id = 0; + sd->npc_shopid = 0; + if (sd->st) { + sd->st->state = END; + sd->st = NULL; + } map->quit(sd); chrif->auth_delete(account_id, char_id, ST_LOGOUT); -- cgit v1.2.3-70-g09d2