| 414 | } |
| 415 | |
| 416 | void |
| 417 | copy_oextra(struct obj *obj2, struct obj *obj1) |
| 418 | { |
| 419 | if (!obj2 || !obj1 || !obj1->oextra) |
| 420 | return; |
| 421 | |
| 422 | if (!obj2->oextra) |
| 423 | obj2->oextra = newoextra(); |
| 424 | if (has_oname(obj1)) |
| 425 | oname(obj2, ONAME(obj1), ONAME_SKIP_INVUPD); |
| 426 | if (has_omonst(obj1)) { |
| 427 | if (!OMONST(obj2)) |
| 428 | newomonst(obj2); |
| 429 | assert(has_omonst(obj2)); |
| 430 | (void) memcpy((genericptr_t) OMONST(obj2), |
| 431 | (genericptr_t) OMONST(obj1), sizeof (struct monst)); |
| 432 | OMONST(obj2)->mextra = (struct mextra *) 0; |
| 433 | OMONST(obj2)->nmon = (struct monst *) 0; |
| 434 | #if 0 |
| 435 | OMONST(obj2)->m_id = next_ident(); |
| 436 | #endif |
| 437 | if (OMONST(obj1)->mextra) |
| 438 | copy_mextra(OMONST(obj2), OMONST(obj1)); |
| 439 | } |
| 440 | if (has_omailcmd(obj1)) { |
| 441 | new_omailcmd(obj2, OMAILCMD(obj1)); |
| 442 | } |
| 443 | if (has_omid(obj1)) { |
| 444 | if (!OMID(obj2)) |
| 445 | newomid(obj2); |
| 446 | OMID(obj2) = OMID(obj1); |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | /* |
| 451 | * Split stack so that its size gets reduced by num. The quantity num is |
no test coverage detected