- while(obj){
- if(obj->ox != nx || obj->oy != ny)
- goto nextobj;
- if(obj->cursed) goto nxti;
- if(obj->olet == FOOD_SYM &&
- (otyp = dogfood(obj)) < MANFOOD &&
- (otyp < ACCFOOD || edog->hungrytime <= moves)){
- /* Note: our dog likes the food so much that he
- might eat it even when it conceals a cursed object */
- nix = nx;
- niy = ny;
- chi = i;
- eatobj:
- edog->eattime =
- moves + obj->quan * objects[obj->otyp].oc_delay;
- if(edog->hungrytime < moves)
- edog->hungrytime = moves;
- edog->hungrytime +=
- 5*obj->quan * objects[obj->otyp].nutrition;
- mtmp->mconf = 0;
- if(cansee(nix,niy))
- pline("%s ate %s.", Monnam(mtmp), doname(obj));
- /* perhaps this was a reward */
- if(otyp != CADAVER)
- edog->apport += 200/(edog->dropdist+moves-edog->droptime);
- delobj(obj);
- goto newdogpos;
- }
- nextobj:
- obj = obj->nobj;
+ while (obj) {
+ if (obj->ox != nx || obj->oy != ny)
+ goto nextobj;
+ if (obj->cursed)
+ goto nxti;
+ if (obj->olet == FOOD_SYM &&
+ (otyp = dogfood(obj)) < MANFOOD &&
+ (otyp < ACCFOOD || edog->hungrytime <= moves)) {
+ /*
+ * Note: our dog likes the food so much that
+ * he might eat it even when it conceals a
+ * cursed object
+ */
+ nix = nx;
+ niy = ny;
+ chi = i;
+ eatobj:
+ edog->eattime =
+ moves + obj->quan * objects[obj->otyp].oc_delay;
+ if (edog->hungrytime < moves)
+ edog->hungrytime = moves;
+ edog->hungrytime +=
+ 5 * obj->quan * objects[obj->otyp].nutrition;
+ mtmp->mconf = 0;
+ if (cansee(nix, niy))
+ pline("%s ate %s.", Monnam(mtmp), doname(obj));
+ /* perhaps this was a reward */
+ if (otyp != CADAVER)
+ edog->apport += 200 / (edog->dropdist + moves - edog->droptime);
+ delobj(obj);
+ goto newdogpos;
+ }
+ nextobj:
+ obj = obj->nobj;