summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/map/map.c6
-rw-r--r--src/map/map.h1
-rw-r--r--src/map/path.c25
-rw-r--r--src/map/skill.c2
5 files changed, 34 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 6f8053c42..b05ede4a1 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -5,6 +5,8 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/02/12
+ * Some path cleanups meant to get the CELL_NOSTACK mod working better with
+ path searching and the like. [Skotlex]
* Optimized functions skill_addtimerskill/skill_cleartimerskill [Skotlex]
* Fixed SC_DANCING for non players (was making dances only last 1 second
for them) [Skotlex]
diff --git a/src/map/map.c b/src/map/map.c
index df3302313..d7cfa11db 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2160,6 +2160,12 @@ int map_getcellp(struct map_data* m,int x,int y,cell_t cellchk)
if (type3 >= battle_config.cell_stack_limit) return 1;
#endif
return (type==1 || type==5 || type2&(CELL_MOONLIT|CELL_ICEWALL));
+ case CELL_CHKSTACK:
+#ifdef CELL_NOSTACK
+ return (type3 >= battle_config.cell_stack_limit);
+#else
+ return 0;
+#endif
case CELL_CHKWALL:
return (type==1/* || type2&CELL_ICEWALL*/); //Uncomment to prevent sniping/casting through the icewall. [Skotlex]
case CELL_CHKWATER:
diff --git a/src/map/map.h b/src/map/map.h
index a8867b934..3a97991cb 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -1138,6 +1138,7 @@ typedef enum {
CELL_CHKNOPASS, // 通過不可(セルタイプ1,5)
CELL_GETTYPE, // セルタイプを返す
CELL_GETCELLTYPE,
+ CELL_CHKSTACK,
CELL_CHKNPC=0x10, // タッチタイプのNPC(セルタイプ0x80フラグ)
CELL_CHKREGEN, // cells that improve regeneration
CELL_CHKPNEUMA,
diff --git a/src/map/path.c b/src/map/path.c
index ad5c06f0f..7cab27683 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -172,6 +172,11 @@ static int can_place(struct map_data *m,int x,int y,int flag)
return 1;
if((flag&0x10000)&&map_getcellp(m,x,y,CELL_CHKGROUND))
return 1;
+#ifdef CELL_NOSTACK
+ //Special flag for CELL_NOSTACK systems. Returns true when the given cell is stacked. [Skotlex]
+ if((flag&0x30000)&&map_getcellp(m,x,y,CELL_CHKSTACK))
+ return 1;
+#endif
return 0;
}
@@ -332,9 +337,18 @@ int path_search(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int
if(!map[m].gat)
return -1;
md=&map[m];
- if(x1<0 || x1>=md->xs || y1<0 || y1>=md->ys || map_getcellp(md,x1,y1,CELL_CHKNOPASS))
+
+ if(x1<0 || x1>=md->xs || y1<0 || y1>=md->ys)
return -1;
+#ifdef CELL_NOSTACK
+ if (map_getcellp(md,x1,y1,CELL_CHKNOPASS) && !map_getcellp(md,x1,y1,CELL_CHKSTACK))
+ return -1;
+#else
+ if (map_getcellp(md,x1,y1,CELL_CHKNOPASS))
+ return -1;
+#endif
+
// easy
dx = (x1-x0<0) ? -1 : 1;
dy = (y1-y0<0) ? -1 : 1;
@@ -366,6 +380,15 @@ int path_search(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int
return 0;
}
+#ifdef CELL_NOSTACK
+ //If you fail by 1 cell, consider easy path successful, too. [Skotlex]
+ if (check_distance(x-x1,y-y1,1)) {
+ wpd->path_len=i;
+ wpd->path_pos=0;
+ wpd->path_half=0;
+ return 0;
+ }
+#endif
if(flag&1)
return -1;
diff --git a/src/map/skill.c b/src/map/skill.c
index 4b77391a2..d10aaf4ea 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -6696,7 +6696,7 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid,
if (alive && battle_config.skill_wall_check) {
//Check if there's a path between cell and center of casting.
struct walkpath_data wpd;
- if (path_search(&wpd,src->m,ux,uy,x,y,1)==-1)
+ if (path_search(&wpd,src->m,ux,uy,x,y,0x30001)==-1)
alive = 0;
}