summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-26 18:26:51 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-26 18:26:51 +0000
commit3396bad1320df4d59a0806a41fafaf99d7b4c9d6 (patch)
tree861c7ecf114a1491de5c60dd23796630907a2b2c /src/map/map.c
parentbab077c56d3f89cc65bb0b00e10046ae8bdaa83a (diff)
downloadhercules-3396bad1320df4d59a0806a41fafaf99d7b4c9d6.tar.gz
hercules-3396bad1320df4d59a0806a41fafaf99d7b4c9d6.tar.bz2
hercules-3396bad1320df4d59a0806a41fafaf99d7b4c9d6.tar.xz
hercules-3396bad1320df4d59a0806a41fafaf99d7b4c9d6.zip
- 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
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c15
1 files changed, 7 insertions, 8 deletions
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;i<c && bl;i++,bl=bl->next){
- if(bl && bl->type&type && bl_list_count<BL_LIST_MAX)
+ if(bl && bl->prev && bl->type&type && bl_list_count<BL_LIST_MAX)
{
xi = bl->x;
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;i<c && bl;i++,bl=bl->next){
- if(bl && bl_list_count<BL_LIST_MAX)
+ if(bl && bl->prev && bl_list_count<BL_LIST_MAX)
{
xi = bl->x;
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;i<bl_list_count;i++)
- if(bl_list[i]->prev) // 有?かどうかチェック
- 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;