From 36e4e442f21ed7193c4510a9bb4fcc733f821757 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 3 Jun 2012 22:41:52 +0000 Subject: Adding new config min_npc_vending_distance which simulates the official 'no vending near npcs' feature. super mega credits to masao git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16227 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index f5066551a..87263e72e 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11734,6 +11734,15 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) clif_displaymessage (sd->fd, msg_txt(204)); // "You can't open a shop on this cell." return; } + + if( vending_checknearnpc(&sd->bl) ) { + char output[50]; + sprintf(output,"You're too close to a NPC, you must be at least %d cells away from any NPC.",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; -- cgit v1.2.3-70-g09d2