destroy object; caller has control over whether to destroy something that ordinarily shouldn't be destroyed */
| 1435 | /* destroy object; caller has control over whether to destroy something |
| 1436 | that ordinarily shouldn't be destroyed */ |
| 1437 | void |
| 1438 | delobj_core( |
| 1439 | struct obj *obj, |
| 1440 | boolean force) /* 'force==TRUE' used when reviving Rider corpses */ |
| 1441 | { |
| 1442 | boolean update_map; |
| 1443 | |
| 1444 | /* obj_resists(obj,0,0) protects the Amulet, the invocation tools, |
| 1445 | and Rider corpses */ |
| 1446 | if (!force && obj_resists(obj, 0, 0)) { |
| 1447 | /* player might be doing something stupid, but we |
| 1448 | * can't guarantee that. assume special artifacts |
| 1449 | * are indestructible via drawbridges, and exploding |
| 1450 | * chests, and golem creation, and ... |
| 1451 | */ |
| 1452 | obj->in_use = 0; /* in case caller has set this to 1 */ |
| 1453 | return; |
| 1454 | } |
| 1455 | update_map = (obj->where == OBJ_FLOOR); |
| 1456 | obj_extract_self(obj); |
| 1457 | if (update_map) { /* floor object's coordinates are always up to date */ |
| 1458 | maybe_unhide_at(obj->ox, obj->oy); |
| 1459 | newsym(obj->ox, obj->oy); |
| 1460 | } |
| 1461 | obfree(obj, (struct obj *) 0); /* frees contents also */ |
| 1462 | } |
| 1463 | |
| 1464 | /* try to find a particular type of object at designated map location */ |
| 1465 | struct obj * |
no test coverage detected