version 1.16 | | version 1.17 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.16 2000/06/13 20:55:50 jec Exp $"; | | * "$Id: apply.c,v 1.17 2000/06/18 20:09:10 jec Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
static void apply_treasure (object *op, object *tmp) | | static void apply_treasure (object *op, object *tmp) |
{ | | { |
object *treas; | | object *treas; |
| | tag_t tmp_tag = tmp->count, op_tag = op->count; |
| | |
/* Nice side effect of new treasure creation method is that the treasure | | /* Nice side effect of new treasure creation method is that the treasure |
for the chest is done when the chest is created, and put into the chest | | for the chest is done when the chest is created, and put into the chest |
| | |
remove_ob(treas); | | remove_ob(treas); |
draw_find(op,treas); | | draw_find(op,treas); |
treas->x=op->x,treas->y=op->y; | | treas->x=op->x,treas->y=op->y; |
insert_ob_in_map(treas,op->map,op); | | treas = insert_ob_in_map (treas, op->map, op); |
| | if (treas && treas->type == RUNE && treas->level |
| | && QUERY_FLAG (op, FLAG_ALIVE)) |
| | spring_trap (treas, op); |
| | if (was_destroyed (op, op_tag) || was_destroyed (tmp, tmp_tag)) |
| | break; |
} while ((treas=tmp->inv)!=NULL); | | } while ((treas=tmp->inv)!=NULL); |
| | |
| | if ( ! was_destroyed (tmp, tmp_tag) && tmp->inv == NULL) |
decrease_ob(tmp); | | decrease_ob(tmp); |
| | |
| | if ( ! was_destroyed (op, op_tag)) { |
/* Done to re-stack map with player on top? */ | | /* Done to re-stack map with player on top? */ |
SET_FLAG (op, FLAG_NO_APPLY); | | SET_FLAG (op, FLAG_NO_APPLY); |
remove_ob(op); | | remove_ob(op); |
insert_ob_in_map(op,op->map,NULL); | | insert_ob_in_map(op,op->map,NULL); |
CLEAR_FLAG (op, FLAG_NO_APPLY); | | CLEAR_FLAG (op, FLAG_NO_APPLY); |
} | | } |
| | } |
| | |
| | |
static void apply_food (object *op, object *tmp) | | static void apply_food (object *op, object *tmp) |