| 1042 | } |
| 1043 | |
| 1044 | bool Items::remove(df::item *item, bool no_uncat) { |
| 1045 | CHECK_NULL_POINTER(item); |
| 1046 | |
| 1047 | if (auto spec_ref = getSpecificRef(item, specific_ref_type::JOB)) |
| 1048 | Job::removeJob(spec_ref->data.job); |
| 1049 | if (!detachItem(item)) |
| 1050 | return false; |
| 1051 | if (auto pos = getPosition(item); pos.isValid()) |
| 1052 | item->pos = pos; |
| 1053 | if (!no_uncat) |
| 1054 | item->uncategorize(); |
| 1055 | |
| 1056 | // Hide them from jobs and the UI until the item can be garbage collected |
| 1057 | item->flags.bits.forbid = true; |
| 1058 | item->flags.bits.hidden = true; |
| 1059 | |
| 1060 | item->flags.bits.removed = true; |
| 1061 | item->flags.bits.garbage_collect = !no_uncat; |
| 1062 | return true; |
| 1063 | } |
| 1064 | |
| 1065 | df::proj_itemst *Items::makeProjectile(df::item *item) |
| 1066 | { using df::global::proj_next_id; |
no test coverage detected