version 1.29 | | version 1.30 |
---|
| | |
/* | | /* |
* static char *rcsid_time_c = | | * static char *rcsid_time_c = |
* "$Id: time.c,v 1.29 2001/08/07 14:35:21 avogl Exp $"; | | * "$Id: time.c,v 1.30 2001/08/07 16:58:13 avogl Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
} | | } |
| | |
void move_teleporter(object *op) { | | void move_teleporter(object *op) { |
| | object *telep = op; /* teleporter object */ |
| | |
/* Floors can't get moved. If, skip over them. */ | | /* Floors can't get moved. If, skip over them. */ |
while (op->above && QUERY_FLAG(op->above, FLAG_IS_FLOOR)) | | while (op->above && QUERY_FLAG(op->above, FLAG_IS_FLOOR)) |
| | |
/* If nothing above us, nothing to do */ | | /* If nothing above us, nothing to do */ |
if (!op->above) return; | | if (!op->above) return; |
| | |
if(EXIT_PATH(op)) { | | if(EXIT_PATH(telep)) { |
if(op->above->type==PLAYER) | | if(op->above->type==PLAYER) |
enter_exit(op->above,op); | | enter_exit(op->above, telep); |
else | | else |
/* Currently only players can transfer maps */ | | /* Currently only players can transfer maps */ |
return; | | return; |
} | | } |
else if(EXIT_X(op)||EXIT_Y(op)) { | | else if(EXIT_X(telep)||EXIT_Y(telep)) { |
if (out_of_map(op->map, EXIT_X(op), EXIT_Y(op))) { | | if (out_of_map(telep->map, EXIT_X(telep), EXIT_Y(telep))) { |
LOG(llevError, "Removed illegal teleporter.\n"); | | LOG(llevError, "Removed illegal teleporter.\n"); |
remove_ob(op); | | remove_ob(telep); |
free_object(op); | | free_object(telep); |
return; | | return; |
} | | } |
transfer_ob(op->above,EXIT_X(op),EXIT_Y(op),0,op); | | transfer_ob(op->above,EXIT_X(telep),EXIT_Y(telep),0,telep); |
} else | | } else |
/* Random teleporter */ | | /* Random teleporter */ |
teleport(op,TELEPORTER,op); | | teleport(op, TELEPORTER, telep); |
} | | } |
| | |
| | |