diff options
author | malufett <malufett.eat.my.binaries@gmail.com> | 2013-03-08 22:51:42 +0800 |
---|---|---|
committer | malufett <malufett.eat.my.binaries@gmail.com> | 2013-03-08 22:51:42 +0800 |
commit | bc63ef1225dadcfa2ba20a9b073de801ee177992 (patch) | |
tree | f25e9d9121a75925e65812d1a5f8d395aed59270 /src/map/clif.c | |
parent | de1e1856cd115feb9834ba716d562e175ac15403 (diff) | |
download | hercules-bc63ef1225dadcfa2ba20a9b073de801ee177992.tar.gz hercules-bc63ef1225dadcfa2ba20a9b073de801ee177992.tar.bz2 hercules-bc63ef1225dadcfa2ba20a9b073de801ee177992.tar.xz hercules-bc63ef1225dadcfa2ba20a9b073de801ee177992.zip |
Fixed Bug #7114
-revised/added 'npc_isnear' where it checks if an NPC is nearby when making chat rooms or using vending.
Signed-off-by: malufett <malufett.eat.my.binaries@gmail.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index bfde233c5..ed9eb1769 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -10400,6 +10400,14 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) clif_skill_fail(sd,1,USESKILL_FAIL_LEVEL,3); return; } + if( npc_isnear(&sd->bl) ) { + // uncomment for more verbose message. + //char output[150]; + //sprintf(output, msg_txt(662), battle_config.min_npc_vendchat_distance); + //clif_displaymessage(sd->fd, output); + clif_skill_fail(sd,1,USESKILL_FAIL_THERE_ARE_NPC_AROUND,0); + return; + } if( len <= 0 ) return; // invalid input @@ -11890,6 +11898,9 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) const char* message = (char*)RFIFOP(fd,4); bool flag = (bool)RFIFOB(fd,84); const uint8* data = (uint8*)RFIFOP(fd,85); + + if( !flag ) + sd->state.prevend = 0; if( sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOROOM ) return; @@ -11902,21 +11913,12 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) return; } - if( vending_checknearnpc(&sd->bl) ) { - char output[150]; - sprintf(output, msg_txt(662), battle_config.min_npc_vending_distance); - clif_displaymessage(sd->fd, output); - clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); - return; - } - if( message[0] == '\0' ) // invalid input return; - vending_openvending(sd, message, flag, data, len/8); + vending_openvending(sd, message, data, len/8); } - /// Guild creation request (CZ_REQ_MAKE_GUILD). /// 0165 <char id>.L <guild name>.24B void clif_parse_CreateGuild(int fd,struct map_session_data *sd) |