MCPcopy Create free account
hub / github.com/NetHack/NetHack / peek_at_iced_corpse_age

Function peek_at_iced_corpse_age

src/mkobj.c:2422–2437  ·  view source on GitHub ↗

* Returns an obj->age for a corpse object on ice, that would be the * actual obj->age if the corpse had just been lifted from the ice. * This is useful when just using obj->age in a check or calculation because * rot timers pertaining to the object don't have to be stopped and * restarted etc. */

Source from the content-addressed store, hash-verified

2420 * restarted etc.
2421 */
2422long
2423peek_at_iced_corpse_age(struct obj *otmp)
2424{
2425 long age, retval = otmp->age;
2426
2427 if (otmp->otyp == CORPSE && otmp->on_ice) {
2428 /* Adjust the age; must be same as obj_timer_checks() for off ice*/
2429 age = svm.moves - otmp->age;
2430 retval += age * (ROT_ICE_ADJUSTMENT - 1) / ROT_ICE_ADJUSTMENT;
2431 debugpline3(
2432 "The %s age has ice modifications: otmp->age = %ld, returning %ld.",
2433 s_suffix(doname(otmp)), otmp->age, retval);
2434 debugpline1("Effective age of corpse: %ld.", svm.moves - retval);
2435 }
2436 return retval;
2437}
2438
2439staticfn void
2440obj_timer_checks(

Callers 4

sacrifice_valueFunction · 0.85
dogfoodFunction · 0.85
eatcorpseFunction · 0.85
edibility_promptsFunction · 0.85

Calls 2

s_suffixFunction · 0.85
donameFunction · 0.85

Tested by

no test coverage detected