summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-26 18:47:04 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-26 18:47:04 +0000
commita028a5fa44a6eb6b0ed87781eb18b8555eb08837 (patch)
tree47a3c8144bf0c11ece28b41767f0c7d6d993869e /src/map/npc.c
parent48f2ec3f27a57a7fe3c60f5475174c075eec890d (diff)
downloadhercules-a028a5fa44a6eb6b0ed87781eb18b8555eb08837.tar.gz
hercules-a028a5fa44a6eb6b0ed87781eb18b8555eb08837.tar.bz2
hercules-a028a5fa44a6eb6b0ed87781eb18b8555eb08837.tar.xz
hercules-a028a5fa44a6eb6b0ed87781eb18b8555eb08837.zip
* Added Bitmap File system
* Added --run_once flag git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@789 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 728e76a9c..9068909ea 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1126,7 +1126,7 @@ static int calc_next_walk_step(struct npc_data *nd)
static int npc_walk(struct npc_data *nd,unsigned int tick,int data)
{
int moveblock;
- int i,ctype;
+ int i;
static int dirx[8]={0,-1,-1,-1,0,1,1,1};
static int diry[8]={1,1,0,-1,-1,-1,0,1};
int x,y,dx,dy;
@@ -1151,8 +1151,7 @@ static int npc_walk(struct npc_data *nd,unsigned int tick,int data)
x = nd->bl.x;
y = nd->bl.y;
- ctype = map_getcell(nd->bl.m,x,y);
- if(ctype == 1 || ctype == 5) {
+ if(map_getcell(nd->bl.m,x,y,CELL_CHKNOPASS)) {
npc_stop_walking(nd,1);
return 0;
}
@@ -1160,8 +1159,7 @@ static int npc_walk(struct npc_data *nd,unsigned int tick,int data)
dx = dirx[nd->dir];
dy = diry[nd->dir];
- ctype = map_getcell(nd->bl.m,x+dx,y+dy);
- if(ctype == 1 || ctype == 5) {
+ if(map_getcell(nd->bl.m,x+dx,y+dy,CELL_CHKNOPASS)) {
npc_walktoxy_sub(nd);
return 0;
}
@@ -1468,11 +1466,9 @@ int npc_parse_warp(char *w1,char *w2,char *w3,char *w4)
for(i=0;i<ys;i++) {
for(j=0;j<xs;j++) {
- int t;
- t=map_getcell(m,x-xs/2+j,y-ys/2+i);
- if (t==1 || t==5)
+ if(map_getcell(m,x-xs/2+j,y-ys/2+i,CELL_CHKNOPASS))
continue;
- map_setcell(m,x-xs/2+j,y-ys/2+i,t|0x80);
+ map_setcell(m,x-xs/2+j,y-ys/2+i,CELL_SETTOUCH);
}
}
@@ -1698,11 +1694,9 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line
for(i=0;i<ys;i++) {
for(j=0;j<xs;j++) {
- int t;
- t=map_getcell(m,x-xs/2+j,y-ys/2+i);
- if (t==1 || t==5)
+ if(map_getcell(m,x-xs/2+j,y-ys/2+i,CELL_CHKNOPASS))
continue;
- map_setcell(m,x-xs/2+j,y-ys/2+i,t|0x80);
+ map_setcell(m,x-xs/2+j,y-ys/2+i,CELL_SETTOUCH);
}
}
}