| 1792 | | |
| 1793 | | /* If the item has charges, set them to the correct level too */ |
| 1794 | | reduce_charges(dst, src->number - amt); |
| | 1792 | |
| | 1793 | /* |
| | 1794 | * If the item has charges/timeouts, set them to the correct level |
| | 1795 | * too. We split off the same amount as distribute_charges. |
| | 1796 | */ |
| | 1797 | if (src->tval == TV_WAND || src->tval == TV_STAFF) |
| | 1798 | { |
| | 1799 | dst->pval = src->pval * amt / src->number; |
| | 1800 | } |
| | 1801 | |
| | 1802 | if (src->tval == TV_ROD) |
| | 1803 | { |
| | 1804 | int max_time = k_info[src->k_idx].time_base * amt; |
| | 1805 | |
| | 1806 | if (src->timeout > max_time) |
| | 1807 | dst->timeout = max_time; |
| | 1808 | else |
| | 1809 | dst->timeout = src->timeout; |
| | 1810 | } |