--- deliantra/server/server/time.C 2006/12/12 20:53:03 1.16 +++ deliantra/server/server/time.C 2006/12/12 21:39:57 1.17 @@ -60,8 +60,8 @@ tmp->level = op->level; insert_ob_in_map (tmp, op->map, op, 0); } - op->remove (); - op->destroy (0); + + op->destroy (); } void @@ -89,8 +89,8 @@ tmp->level = op->level; insert_ob_in_map (tmp, op->map, op, 0); } - op->remove (); - op->destroy (0); + + op->destroy (); } /* Will generate a monster according to content @@ -222,8 +222,8 @@ fix_player (op->env); } } - op->remove (); - op->destroy (0); + + op->destroy (); } void @@ -231,14 +231,16 @@ { if (--op->stats.food > 0) return; + CLEAR_FLAG (op, FLAG_APPLIED); + if (op->env != NULL) { change_abil (op->env, op); fix_player (op->env); } - op->remove (); - op->destroy (0); + + op->destroy (); } void @@ -246,10 +248,10 @@ { if (op->env == NULL || !QUERY_FLAG (op->env, FLAG_ALIVE) || op->env->stats.hp < 0) { - op->remove (); - op->destroy (0); + op->destroy (); return; } + if (op->stats.food == 1) { /* need to remove the object before fix_player is called, else fix_player @@ -261,10 +263,11 @@ fix_player (op->env); new_draw_info (NDI_UNIQUE, 0, op->env, "You feel much better now."); } - op->remove (); - op->destroy (0); + + op->destroy (); return; } + if (op->env->type == PLAYER) { op->env->stats.food--; @@ -594,8 +597,7 @@ if (payload == NULL) return NULL; payload->remove (); - op->remove (); - op->destroy (0); + op->destroy (); return payload; } @@ -632,8 +634,7 @@ if (rndm (0, 99) < op->stats.food) { /* Small chance of breaking */ - op->remove (); - op->destroy (0); + op->destroy (); return NULL; } @@ -690,8 +691,7 @@ payload->remove (); clear_owner (payload); insert_ob_in_map (payload, op->map, payload, 0); - op->remove (); - op->destroy (0); + op->destroy (); } else { @@ -715,8 +715,7 @@ if (op->map == NULL) { LOG (llevError, "BUG: Arrow had no map.\n"); - op->remove (); - op->destroy (0); + op->destroy (); return; } @@ -733,8 +732,7 @@ */ if (op->inv == NULL) { - op->remove (); - op->destroy (0); + op->destroy (); return; } @@ -955,7 +953,7 @@ { j = find_first_free_spot (tmp, op->map, op->x, op->y); if (j == -1) /* No free spot */ - tmp->destroy (0); + tmp->destroy (); else { tmp->x = op->x + freearr_x[j], tmp->y = op->y + freearr_y[j]; @@ -963,7 +961,8 @@ } } } - op->destroy (0); + + op->destroy (); } void @@ -1010,12 +1009,13 @@ if (out_of_map (head->map, EXIT_X (head), EXIT_Y (head))) { LOG (llevError, "Removed illegal teleporter.\n"); - head->remove (); - head->destroy (0); + head->destroy (); return; } + if (INVOKE_OBJECT (TRIGGER, op, ARG_OBJECT (tmp))) return; + transfer_ob (tmp, EXIT_X (head), EXIT_Y (head), 0, head); } else @@ -1135,9 +1135,9 @@ if (QUERY_FLAG (op, FLAG_LIFESAVE) && op->stats.hp-- < 0) { op->remove (); - op->destroy (0); return; } + nx = op->x + freearr_x[dir]; ny = op->y + freearr_y[dir]; m = op->map; @@ -1225,18 +1225,17 @@ if (strcmp (op->other_arch->name, tmp->arch->name) == 0) { if (op->level <= 0) - { - tmp->remove (); - tmp->destroy (0); - } + tmp->destroy (); else { uint64 new_nrof = (uint64) tmp->nrof * op->level; if (new_nrof >= 1UL << 31) new_nrof = 1UL << 31; + tmp->nrof = new_nrof; } + break; } } @@ -1302,7 +1301,7 @@ /* Make sure this multipart object fits */ if (new_ob->arch->more && ob_blocked (new_ob, creator->map, creator->x, creator->y)) { - new_ob->destroy (0); + new_ob->destroy (); return; } @@ -1343,10 +1342,7 @@ } if (tmp2) - { - tmp2->remove (); - tmp2->destroy (0); - } + tmp2->destroy (); /* cycle through his inventory to look for the MARK we want to * place @@ -1385,8 +1381,7 @@ if (op->stats.hp == 0) { /* marker expires--granted mark number limit */ - op->remove (); - op->destroy (0); + op->destroy (); return; } } @@ -1445,7 +1440,7 @@ if (QUERY_FLAG (op, FLAG_SEE_ANYWHERE)) make_sure_not_seen (op); - op->destroy (0); + op->destroy (); } return 1;