From eebfc36c15910697eba22ffa8229c6656add6e39 Mon Sep 17 00:00:00 2001 From: Lance Date: Sat, 29 Apr 2006 13:25:12 +0000 Subject: * Reverted npc_checknear to exclude check for class_ -1. * Removed npc_checknear in npc_buysellsel, npc_selllist and npc_buylist as enough preventive measures of hacking are already implemented. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6370 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 4 ++++ src/map/npc.c | 17 +++++++++-------- src/map/script.c | 5 +++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index e01180818..7fa702f8c 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/04/29 + * Reverted npc_checknear to exclude check for class_ -1. + * Removed npc_checknear in npc_buysellsel, npc_selllist and npc_buylist + as enough preventive measures of hacking are already implemented. + [Lance] * Updated STEAL skill (WIP), added a battle config option: [Lupus] 'skill_steal_max_tries' to set max number of stealing tries. It could help to fix stealing exploit on mobs with few drops diff --git a/src/map/npc.c b/src/map/npc.c index af2ed2c91..2f4745948 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -979,8 +979,9 @@ int npc_checknear(struct map_session_data *sd,int id) return 1; } - if (nd->class_<0) // イベント系は常にOK - return 0; + // Reprecated, please do not uncomment this. [Lance] + //if (nd->class_<0) // イベント系は常にOK + // return 0; // エリア判定 if (nd->bl.m!=sd->bl.m || @@ -1084,8 +1085,8 @@ int npc_buysellsel(struct map_session_data *sd,int id,int type) nullpo_retr(1, sd); - if (npc_checknear(sd,id)) - return 1; + //if (npc_checknear(sd,id)) + // return 1; nd=(struct npc_data *)map_id2bl(id); if (nd->bl.subtype!=SHOP) { @@ -1119,8 +1120,8 @@ int npc_buylist(struct map_session_data *sd,int n,unsigned short *item_list) nullpo_retr(3, sd); nullpo_retr(3, item_list); - if (npc_checknear(sd,sd->npc_shopid)) - return 3; + //if (npc_checknear(sd,sd->npc_shopid)) + // return 3; nd=(struct npc_data*)map_id2bl(sd->npc_shopid); if (nd->bl.subtype!=SHOP) @@ -1213,8 +1214,8 @@ int npc_selllist(struct map_session_data *sd,int n,unsigned short *item_list) nullpo_retr(1, sd); nullpo_retr(1, item_list); - if (npc_checknear(sd,sd->npc_shopid)) - return 1; + //if (npc_checknear(sd,sd->npc_shopid)) + // return 1; for(i=0,z=0;i=MAX_INVENTORY) diff --git a/src/map/script.c b/src/map/script.c index 71993f33e..145b09ea6 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -10898,9 +10898,10 @@ int run_script_main(struct script_state *st) struct block_list *bl; st->state = RUN; if(st->oid && st->rid && (bl = map_id2bl(st->oid))){ - if(bl->type == BL_PC){ + // Perfomance impact, use buildin_doevent instead for interactive item scripts. + /*if(bl->type == BL_PC){ clif_sendfakenpc(((TBL_PC *)bl),dummy_npc_id); - } else if(bl->type == BL_NPC){ + } else */if(bl->type == BL_NPC){ if(npc_checknear(((TBL_PC *)bl), bl->id)) clif_sendfakenpc(((struct map_session_data *)bl),st->oid); } -- cgit v1.2.3-70-g09d2