version 1.4 | | version 1.5 |
---|
| | |
/* | | /* |
* static char *rcsid_move_c = | | * static char *rcsid_move_c = |
* "$Id: move.c,v 1.4 2001/03/30 07:27:48 mwedel Exp $"; | | * "$Id: move.c,v 1.5 2001/07/14 04:11:18 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
Copyright (C) 1994 Mark Wedel | | Copyright (C) 2001 Mark Wedel |
Copyright (C) 1992 Frank Tore Johansen | | Copyright (C) 1992 Frank Tore Johansen |
| | |
This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify |
| | |
along with this program; if not, write to the Free Software | | along with this program; if not, write to the Free Software |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| | |
The author can be reached via e-mail to master@rahul.net | | The author can be reached via e-mail to mwedel@scruz.net |
*/ | | */ |
| | |
#include <global.h> | | #include <global.h> |
| | |
| | |
/* Re insert object if we removed it above */ | | /* Re insert object if we removed it above */ |
if(op->more!=NULL && op->head==NULL) | | if(op->more!=NULL && op->head==NULL) |
insert_ob_in_map(op,op->map,originator); | | insert_ob_in_map(op,op->map,originator,0); |
return 0; | | return 0; |
} | | } |
| | |
| | |
if(!move_ob(tmp,dir,originator)) { | | if(!move_ob(tmp,dir,originator)) { |
op->more=tmp; | | op->more=tmp; |
if(op->head==NULL) | | if(op->head==NULL) |
insert_ob_in_map(op,op->map,originator); | | insert_ob_in_map(op,op->map,originator,0); |
return 0; | | return 0; |
} | | } |
else op->more=tmp; | | else op->more=tmp; |
| | |
| | |
/* If head of object (or single part object), reinsert into map. */ | | /* If head of object (or single part object), reinsert into map. */ |
if(op->head==NULL) | | if(op->head==NULL) |
insert_ob_in_map(op,op->map,originator); | | insert_ob_in_map(op,op->map,originator,0); |
| | |
if (op->type==PLAYER) { | | if (op->type==PLAYER) { |
esrv_map_scroll(&op->contr->socket, freearr_x[dir],freearr_y[dir]); | | esrv_map_scroll(&op->contr->socket, freearr_x[dir],freearr_y[dir]); |
| | |
for(tmp=op;tmp!=NULL;tmp=tmp->more) | | for(tmp=op;tmp!=NULL;tmp=tmp->more) |
tmp->x=x+freearr_x[i]+(tmp->arch==NULL?0:tmp->arch->clone.x), | | tmp->x=x+freearr_x[i]+(tmp->arch==NULL?0:tmp->arch->clone.x), |
tmp->y=y+freearr_y[i]+(tmp->arch==NULL?0:tmp->arch->clone.y); | | tmp->y=y+freearr_y[i]+(tmp->arch==NULL?0:tmp->arch->clone.y); |
return insert_ob_in_map(op,op->map,originator) == NULL; | | return insert_ob_in_map(op,op->map,originator,0) == NULL; |
} | | } |
| | |
/* | | /* |
| | |
(tmp->arch==NULL?0:tmp->arch->clone.x), | | (tmp->arch==NULL?0:tmp->arch->clone.x), |
tmp->y=other_teleporter->y+freearr_y[k]+ | | tmp->y=other_teleporter->y+freearr_y[k]+ |
(tmp->arch==NULL?0:tmp->arch->clone.y); | | (tmp->arch==NULL?0:tmp->arch->clone.y); |
return insert_ob_in_map(teleported,other_teleporter->map,originator) == NULL; | | return insert_ob_in_map(teleported,other_teleporter->map,originator,0) == NULL; |
} | | } |
| | |
void recursive_roll(object *op,int dir,object *pusher) { | | void recursive_roll(object *op,int dir,object *pusher) { |
| | |
remove_ob(op); | | remove_ob(op); |
for(tmp=op; tmp!=NULL; tmp=tmp->more) | | for(tmp=op; tmp!=NULL; tmp=tmp->more) |
tmp->x+=freearr_x[dir],tmp->y+=freearr_y[dir]; | | tmp->x+=freearr_x[dir],tmp->y+=freearr_y[dir]; |
insert_ob_in_map(op,op->map,pusher); | | insert_ob_in_map(op,op->map,pusher,0); |
return 1; | | return 1; |
} | | } |
| | |
| | |
temp = pusher->y; | | temp = pusher->y; |
pusher->y = who->y; | | pusher->y = who->y; |
who->y = temp; | | who->y = temp; |
insert_ob_in_map (who,who->map,pusher); | | insert_ob_in_map (who,who->map,pusher,0); |
insert_ob_in_map (pusher,pusher->map,pusher); | | insert_ob_in_map (pusher,pusher->map,pusher,0); |
return 0; | | return 0; |
} | | } |
if(QUERY_FLAG(who,FLAG_UNAGGRESSIVE) && owner != pusher) | | if(QUERY_FLAG(who,FLAG_UNAGGRESSIVE) && owner != pusher) |