From fortune!hpda!hplabs!hao!seismo!uwvax!uwmacc!myers Tue Jun 4 17:12:30 1985 Relay-Version: version B 2.10.2 9/18/84; site wdl1.UUCP Posting-Version: version B 2.10.2 9/5/84; site uwmacc.UUCP Path: wdl1!fortune!hpda!hplabs!hao!seismo!uwvax!uwmacc!myers From: myers@uwmacc.UUCP (Latitudinarian Lobster) Newsgroups: net.games.hack Subject: 1.0.2 dog and cockatrice fix Message-ID: <1186@uwmacc.UUCP> Date: 5 Jun 85 00:12:30 GMT Article-I.D.: uwmacc.1186 Posted: Tue Jun 4 17:12:30 1985 Date-Received: 9 Jun 85 16:38:17 GMT Distribution: net Organization: UWisconsin-Madison Academic Comp Center Lines: 98 I've hacked hack so that dogs will avoid spots with a dead cockatrice and will also refuse to pick one up if the dog happens to be there for some reason (like tripe). The following context diff also contains a couple older fixes. *** hack.dog.c.old Fri Apr 26 13:51:29 1985 --- hack.dog.c Tue Jun 4 19:04:45 1985 *************** *** 142,147 dogroom = inroom(omx,omy); uroom = inroom(u.ux,u.uy); udist = dist(omx,omy); /* if we are carrying sth then we drop it (perhaps near @) */ /* Note: if apport == 1 then our behaviour is independent of udist */ --- 142,148 ----- dogroom = inroom(omx,omy); uroom = inroom(u.ux,u.uy); udist = dist(omx,omy); + if (udist == 0) return(0); /* aeb */ /* if we are carrying sth then we drop it (perhaps near @) */ /* Note: if apport == 1 then our behaviour is independent of udist */ *************** *** 150,155 if(rn2(10) < edog->apport){ relobj(mtmp, (int) mtmp->minvis); if(edog->apport > 1) edog->apport--; } } else { if(obj = o_at(omx,omy)) if(!index("0_", obj->olet)){ --- 151,158 ----- if(rn2(10) < edog->apport){ relobj(mtmp, (int) mtmp->minvis); if(edog->apport > 1) edog->apport--; + edog->dropdist = udist; /* hpscdi!jon */ + edog->droptime = moves; } } else { if(obj = o_at(omx,omy)) *************** *** 152,158 if(edog->apport > 1) edog->apport--; } } else { ! if(obj = o_at(omx,omy)) if(!index("0_", obj->olet)){ if((otyp = dogfood(obj)) <= CADAVER){ nix = omx; niy = omy; --- 155,162 ----- edog->droptime = moves; } } else { ! if(obj = o_at(omx,omy)) ! if(!index("0_", obj->olet) && !(obj->otyp == DEAD_COCKATRICE)){ if((otyp = dogfood(obj)) <= CADAVER){ nix = omx; niy = omy; *************** *** 283,289 if(rn2(10)) continue; } ! /* dog eschewes cursed objects */ /* but likes dog food */ obj = fobj; while(obj){ --- 287,293 ----- if(rn2(10)) continue; } ! /* dog eschewes cursed objects and dead cockatrices */ /* but likes dog food */ obj = fobj; while(obj){ *************** *** 289,295 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)){ --- 293,299 ----- while(obj){ if(obj->ox != nx || obj->oy != ny) goto nextobj; ! if( (obj->cursed) || (obj->otyp == DEAD_COCKATRICE) ) goto nxti; if(obj->olet == FOOD_SYM && (otyp = dogfood(obj)) < MANFOOD && (otyp < ACCFOOD || edog->hungrytime <= moves)){