called when 'obj->globby' is set so we don't recheck it here */
| 3417 | |
| 3418 | /* called when 'obj->globby' is set so we don't recheck it here */ |
| 3419 | staticfn void |
| 3420 | check_glob(struct obj *obj, const char *mesg) |
| 3421 | { |
| 3422 | #define LOWEST_GLOB GLOB_OF_GRAY_OOZE |
| 3423 | #define HIGHEST_GLOB GLOB_OF_BLACK_PUDDING |
| 3424 | if (obj->quan != 1L || obj->owt == 0 |
| 3425 | || obj->otyp < LOWEST_GLOB || obj->otyp > HIGHEST_GLOB |
| 3426 | #if 0 /* |
| 3427 | * This was relevant before the shrink_glob timer was adopted but |
| 3428 | * now any glob could have a weight that isn't a multiple of 20. |
| 3429 | */ |
| 3430 | /* a partially eaten glob could have any non-zero weight but an |
| 3431 | intact one should weigh an exact multiple of base weight (20) */ |
| 3432 | || ((obj->owt % objects[obj->otyp].oc_weight) != 0 && !obj->oeaten) |
| 3433 | #endif |
| 3434 | ) { |
| 3435 | char mesgbuf[BUFSZ], globbuf[QBUFSZ]; |
| 3436 | |
| 3437 | Sprintf(globbuf, " glob %d,quan=%ld,owt=%u ", |
| 3438 | obj->otyp, obj->quan, obj->owt); |
| 3439 | mesg = strsubst(strcpy(mesgbuf, mesg), " obj ", globbuf); |
| 3440 | insane_object(obj, ofmt0, mesg, |
| 3441 | (obj->where == OBJ_MINVENT) ? obj->ocarry : 0); |
| 3442 | } |
| 3443 | } |
| 3444 | |
| 3445 | /* check an object in hero's or monster's inventory which has worn mask set */ |
| 3446 | staticfn void |
no test coverage detected