From a028a5fa44a6eb6b0ed87781eb18b8555eb08837 Mon Sep 17 00:00:00 2001 From: celest Date: Sun, 26 Dec 2004 18:47:04 +0000 Subject: * 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 --- src/map/npc.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/map/npc.c') 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