From 3396bad1320df4d59a0806a41fafaf99d7b4c9d6 Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 26 Jun 2006 18:26:51 +0000 Subject: - Corrected unit id of desperado and Ground Drift using jA's info. - Rough implementation of Ground Drift according to description and jA info. - Implemented Tatami Gaeshi using skill description and jA implementation for reference. - map_foreachinpath calls will no longer go beyond the target point, as this function is required for skills other than SharpShooting now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7344 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/map.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index e24a4ba7f..e6ed26db6 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1134,13 +1134,13 @@ int map_foreachinpath(int (*func)(struct block_list*,va_list),int m,int x0,int y bl = map[m].block[bx+by*map[m].bxs]; c = map[m].block_count[bx+by*map[m].bxs]; for(i=0;inext){ - if(bl && bl->type&type && bl_list_countprev && bl->type&type && bl_list_countx; yi = bl->y; k = (xi-x0)*(x1-x0) + (yi-y0)*(y1-y0); - if (k < 0)// || k > magnitude2) //No check to see if it lies after the target's point. + if (k < 0 || k > magnitude2) //Since more skills use this, check for ending point as well. continue; //All these shifts are to increase the precision of the intersection point and distance considering how it's @@ -1167,12 +1167,12 @@ int map_foreachinpath(int (*func)(struct block_list*,va_list),int m,int x0,int y bl = map[m].block_mob[bx+by*map[m].bxs]; c = map[m].block_mob_count[bx+by*map[m].bxs]; for(i=0;inext){ - if(bl && bl_list_countprev && bl_list_countx; yi = bl->y; k = (xi-x0)*(x1-x0) + (yi-y0)*(y1-y0); - if (k < 0)// || k > magnitude2) //No check to see if it lies after the target's point. + if (k < 0 || k > magnitude2) continue; k = (k<<4)/magnitude2; //k will be between 1~16 instead of 0~1 @@ -1197,13 +1197,12 @@ int map_foreachinpath(int (*func)(struct block_list*,va_list),int m,int x0,int y ShowWarning("map_foreachinpath: block count too many!\n"); } - map_freeblock_lock(); // メモリからの解放を禁止する + map_freeblock_lock(); for(i=blockcount;iprev) // 有?かどうかチェック - returnCount += func(bl_list[i],ap); + returnCount += func(bl_list[i],ap); - map_freeblock_unlock(); // 解放を許可する + map_freeblock_unlock(); va_end(ap); bl_list_count = blockcount; -- cgit v1.2.3-70-g09d2