version 1.39 | | version 1.40 |
---|
| | |
/* | | /* |
* static char *rcsid_move_c = | | * static char *rcsid_move_c = |
* "$Id: move.c,v 1.39 2006/02/07 07:54:46 mwedel Exp $"; | | * "$Id: move.c,v 1.40 2006/03/18 15:05:37 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
#include <sproto.h> | | #include <sproto.h> |
#endif | | #endif |
| | |
/* | | /** |
* move_object() tries to move object op in the direction "dir". | | * move_object() tries to move object op in the direction "dir". |
* If it fails (something blocks the passage), it returns 0, | | * If it fails (something blocks the passage), it returns 0, |
* otherwise 1. | | * otherwise 1. |
| | |
} | | } |
| | |
| | |
/* object op is trying to move in direction dir. | | /** |
| | * object op is trying to move in direction dir. |
* originator is typically the same as op, but | | * originator is typically the same as op, but |
* can be different if originator is causing op to | | * can be different if originator is causing op to |
* move (originator is pushing op) | | * move (originator is pushing op) |
| | |
} | | } |
| | |
| | |
/* | | /** |
* transfer_ob(): Move an object (even linked objects) to another spot | | * transfer_ob(): Move an object (even linked objects) to another spot |
* on the same map. | | * on the same map. |
* | | * |
| | |
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); |
| | |
tmp = insert_ob_in_map(op,op->map,originator,0); | | tmp = insert_ob_in_map(op,op->map,originator,0); |
if (op && op->type == PLAYER) MapNewmapCmd(op->contr); | | if (op && op->type == PLAYER) map_newmap_cmd(op->contr); |
if (tmp) return 0; | | if (tmp) return 0; |
else return 1; | | else return 1; |
} | | } |
| | |
/* | | /** |
* Return value: 1 if object was destroyed, 0 otherwise. | | * Return value: 1 if object was destroyed, 0 otherwise. |
* Modified so that instead of passing the 'originator' that had no | | * Modified so that instead of passing the 'originator' that had no |
* real use, instead we pass the 'user' of the teleporter. All the | | * real use, instead we pass the 'user' of the teleporter. All the |
| | |
(tmp->arch==NULL?0:tmp->arch->clone.y); | | (tmp->arch==NULL?0:tmp->arch->clone.y); |
} | | } |
tmp = insert_ob_in_map(user,other_teleporter->map,NULL,0); | | tmp = insert_ob_in_map(user,other_teleporter->map,NULL,0); |
if (tmp && tmp->type == PLAYER) MapNewmapCmd(tmp->contr); | | if (tmp && tmp->type == PLAYER) map_newmap_cmd(tmp->contr); |
return (tmp == NULL); | | return (tmp == NULL); |
} | | } |
| | |
| | |
return; | | return; |
} | | } |
| | |
/* | | /** |
* This is a new version of blocked, this one handles objects | | * This is a new version of blocked, this one handles objects |
* that can be passed through by monsters with the CAN_PASS_THRU defined. | | * that can be passed through by monsters with the CAN_PASS_THRU defined. |
* | | * |
| | |
return 0; | | return 0; |
} | | } |
| | |
/* | | /** |
* this is not perfect yet. | | * this is not perfect yet. |
* it does not roll objects behind multipart objects properly. | | * it does not roll objects behind multipart objects properly. |
* Support for rolling multipart objects is questionable. | | * Support for rolling multipart objects is questionable. |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* returns 1 if pushing invokes a attack, 0 when not */ | | /** returns 1 if pushing invokes a attack, 0 when not */ |
int push_ob(object *who, int dir, object *pusher) { | | int push_ob(object *who, int dir, object *pusher) { |
int str1, str2; | | int str1, str2; |
object *owner; | | object *owner; |