item * crtr_rm_item(creature * c, int i) { item * it = c->inv->itms[i]; if (item_equipped(it, c)) { crtr_unequip(c, it->f->slot); } inv_rm(c->inv, i); return it; }
// // Teleports an item // Fails if cannot add to the destination tile inventory // int item_tele(item * it, int x, int y, zone * z) { int i = inv_add(z->tiles[x][y].inv, it); if (i != INVALID) { if (it->of != NULL) { inv_rm(it->of, it->i); } it->of = z->tiles[x][y].inv; it->i = i; return 1; } return 0; }