* The organic material has rotted away while buried. As an expansion, * we could add partial damage. A damage count is kept in the object * and every time we are called we increment the count and reschedule another * timeout. Eventually the object rots away. * * This is used by buried objects other than corpses. When a container rots * away, any contents become newly buried objects. */
| 2122 | */ |
| 2123 | /* ARGSUSED */ |
| 2124 | void |
| 2125 | rot_organic(anything *arg, long timeout UNUSED) |
| 2126 | { |
| 2127 | struct obj *obj = arg->a_obj; |
| 2128 | |
| 2129 | while (Has_contents(obj)) { |
| 2130 | /* We don't need to place contained object on the floor |
| 2131 | first, but we do need to update its map coordinates. */ |
| 2132 | obj->cobj->ox = obj->ox, obj->cobj->oy = obj->oy; |
| 2133 | /* Everything which can be held in a container can also be |
| 2134 | buried, so bury_an_obj's use of obj_extract_self insures |
| 2135 | that Has_contents(obj) will eventually become false. */ |
| 2136 | (void) bury_an_obj(obj->cobj, (boolean *) 0); |
| 2137 | } |
| 2138 | obj_extract_self(obj); |
| 2139 | obfree(obj, (struct obj *) 0); |
| 2140 | } |
| 2141 | |
| 2142 | /* |
| 2143 | * Called when a corpse has rotted completely away. |
no test coverage detected