a glob has shrunk away to nothing; handle owornmask, then delete glob */
| 1670 | |
| 1671 | /* a glob has shrunk away to nothing; handle owornmask, then delete glob */ |
| 1672 | staticfn void |
| 1673 | shrinking_glob_gone(struct obj *obj) |
| 1674 | { |
| 1675 | xint16 owhere = obj->where; |
| 1676 | |
| 1677 | if (owhere == OBJ_INVENT) { |
| 1678 | if (obj->owornmask) { |
| 1679 | remove_worn_item(obj, FALSE); |
| 1680 | stop_occupation(); |
| 1681 | } |
| 1682 | useupall(obj); /* freeinv()+obfree() */ |
| 1683 | } else { |
| 1684 | if (owhere == OBJ_MIGRATING) { |
| 1685 | /* destination flag overloads owornmask; clear it so obfree()'s |
| 1686 | check for freeing a worn object doesn't get a false hit */ |
| 1687 | obj->owornmask = 0L; |
| 1688 | } else if (owhere == OBJ_MINVENT) { |
| 1689 | /* monsters don't wield globs so this isn't strictly needed */ |
| 1690 | if (obj->owornmask && obj == MON_WEP(obj->ocarry)) |
| 1691 | setmnotwielded(obj->ocarry, obj); /* clears owornmask */ |
| 1692 | } |
| 1693 | /* remove the glob from whatever list it's on and then delete it; |
| 1694 | if it's contained, obj_extract_self() will update the container's |
| 1695 | weight and if nested, the enclosing containers' weights too */ |
| 1696 | obj_extract_self(obj); |
| 1697 | if (owhere == OBJ_FLOOR) |
| 1698 | maybe_unhide_at(obj->ox, obj->oy); |
| 1699 | obfree(obj, (struct obj *) 0); |
| 1700 | } |
| 1701 | } |
| 1702 | |
| 1703 | void |
| 1704 | maybe_adjust_light(struct obj *obj, int old_range) |
no test coverage detected