summaryrefslogtreecommitdiff
path: root/src/map/pc.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/pc.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/pc.c')
-rw-r--r--src/map/pc.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 376efb313..d314d2e30 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3822,7 +3822,7 @@ int pc_steal_coin(struct map_session_data *sd,struct block_list *bl)
int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrtype)
{
char mapname[24];
- int m=0,c=0,disguise=0;
+ int m=0,disguise=0;
nullpo_retr(0, sd);
@@ -3935,7 +3935,7 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
if(x <0 || x >= map[m].xs || y <0 || y >= map[m].ys)
x=y=0;
- if((x==0 && y==0) || (c=read_gat(m,x,y))==1 || c==5){
+ if((x==0 && y==0) || map_getcell(m,x,y,CELL_CHKNOPASS)){
if(x||y) {
if(battle_config.error_log)
printf("stacked (%d,%d)\n",x,y);
@@ -3943,7 +3943,7 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
do {
x=rand()%(map[m].xs-2)+1;
y=rand()%(map[m].ys-2)+1;
- } while((c=read_gat(m,x,y))==1 || c==5);
+ } while(map_getcell(m,x,y,CELL_CHKNOPASS));
}
if(sd->mapname[0] && sd->bl.prev != NULL){
@@ -4011,7 +4011,7 @@ int pc_setpos(struct map_session_data *sd,char *mapname_org,int x,int y,int clrt
*------------------------------------------
*/
int pc_randomwarp(struct map_session_data *sd, int type) {
- int x,y,c,i=0;
+ int x,y,i=0;
int m;
nullpo_retr(0, sd);
@@ -4024,7 +4024,7 @@ int pc_randomwarp(struct map_session_data *sd, int type) {
do{
x=rand()%(map[m].xs-2)+1;
y=rand()%(map[m].ys-2)+1;
- } while (((c=read_gat(m,x,y)) == 1 || c == 5) && (i++) < 1000);
+ }while(map_getcell(m,x,y,CELL_CHKNOPASS) && (i++)<1000 );
if (i < 1000)
pc_setpos(sd,map[m].name,x,y,type);
@@ -4129,7 +4129,7 @@ static int calc_next_walk_step(struct map_session_data *sd)
static int pc_walk(int tid,unsigned int tick,int id,int data)
{
struct map_session_data *sd;
- int i,ctype;
+ int i;
int moveblock;
int x,y,dx,dy;
@@ -4162,16 +4162,14 @@ static int pc_walk(int tid,unsigned int tick,int id,int data)
x = sd->bl.x;
y = sd->bl.y;
- ctype = map_getcell(sd->bl.m,x,y);
- if(ctype == 1 || ctype == 5) {
+ if(map_getcell(sd->bl.m,x,y,CELL_CHKNOPASS)) {
pc_stop_walking(sd,1);
return 0;
}
sd->dir=sd->head_dir=sd->walkpath.path[sd->walkpath.path_pos];
dx = dirx[(int)sd->dir];
dy = diry[(int)sd->dir];
- ctype = map_getcell(sd->bl.m,x+dx,y+dy);
- if(ctype == 1 || ctype == 5) {
+ if(map_getcell(sd->bl.m,x,y,CELL_CHKNOPASS)) {
pc_walktoxy_sub(sd);
return 0;
}
@@ -4252,7 +4250,7 @@ static int pc_walk(int tid,unsigned int tick,int id,int data)
skill_unit_move(&sd->bl,tick,1); // スキルユニットの?査
- if(map_getcell(sd->bl.m,x,y)&0x80)
+ if(map_getcell(sd->bl.m,x,y,CELL_CHKTOUCH))
npc_touch_areanpc(sd,sd->bl.m,x,y);
else
sd->areanpc_id=0;
@@ -4378,15 +4376,14 @@ int pc_randomwalk(struct map_session_data *sd,int tick)
nullpo_retr(0, sd);
if(DIFF_TICK(sd->next_walktime,tick)<0){
- int i,x,y,c,d;
+ int i,x,y,d;
d = rand()%7+5;
for(i=0;i<retrycount;i++){ // Search of a movable place
int r=rand();
x=sd->bl.x+r%(d*2+1)-d;
y=sd->bl.y+r/(d*2+1)%(d*2+1)-d;
- if((c=map_getcell(sd->bl.m,x,y))!=1 && c!=5 && pc_walktoxy(sd,x,y)==0){
+ if((map_getcell(sd->bl.m,x,y,CELL_CHKPASS)) && pc_walktoxy(sd,x,y)==0)
break;
- }
}
// Working on this part later [celest]
/*for(i=c=0;i<sd->walkpath.path_len;i++){ // The next walk start time is calculated.
@@ -4450,7 +4447,7 @@ int pc_movepos(struct map_session_data *sd,int dst_x,int dst_y)
skill_unit_move(&sd->bl,gettick(),dist+7); // スキルユニットの?査
- if(map_getcell(sd->bl.m,sd->bl.x,sd->bl.y)&0x80)
+ if(map_getcell(sd->bl.m,sd->bl.x,sd->bl.y,CELL_CHKTOUCH))
npc_touch_areanpc(sd,sd->bl.m,sd->bl.x,sd->bl.y);
else
sd->areanpc_id=0;