Article View: net.games.hack
Article #822Tainted meat [ Spoiler ] [ Possible bug fix ]
From: Ron Wessels
Date: Thu, 27 Jun 1985 01:18
Date: Thu, 27 Jun 1985 01:18
45 lines
2472 bytes
2472 bytes
> From: ryan@ucla-cs.UUCP
>
> By the way, I have never encountered this problem due to the fact
> that i eat the corpse as soon as possible....(like after the kill)
> From: srt@ucla-cs.UUCP
>
> I ate these corpses immediately after killing them, and they were tainted.
Sorry, Ryan, but that doesn't guarantee anything. I once ate a fresh
giant rat corpse and it was tainted. I was not impressed!
As a result of this discussion, I finally got around to checking the
source. You're supposed to have a guaranteed 50-move grace period
before tainting can occur. I checked around, and the only thing I
could spot was a *really* obscure "bug" that never happens.
As background, the age of any item is stored as a timestamp (# of moves
played) when it was created. The "true" age can then be determined by
subtracting this from the current move count.
The tainted meat test looks like
if (moves > age + 50 + rnd(100)) {
/* it is tainted */
...
Well, if "age+50+rnd(100)" overflows the maximum value for long's
but "moves" hasn't overflowed yet (I *told* you it was obscure -
the maximum "window" for this is 149 moves and occurs after about
2147483600 moves!), the test will always return tainted. If this
really is the bug, it can be fixed by changing the test to
if (moves - age > 50 + rnd(100)) {
...
[ This is at the top of eatcorpse() in hack.eat.c, if you actually
plan to fix this ].
The problem is that this is a ridiculous number of required moves,
unless "moves" somehow gets corrupted. If so, this is one of the
few places that you'd notice, since only count differences are ever
looked at. Either way, the change can't hurt, and might help.
--
Ron Wessels Computer Systems Research Institute University of Toronto
UUCP: {decvax,floyd,ihnp4,linus,utzoo,uw-beaver}!utcsri!ron
CSNET: ron@Toronto
ARPA: ron%Toronto@CSNet-Relay
Technical Details
Message-ID:
<218@uthub.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utcsri!utai!uthub!ronReferences:
<6001@ucla-cs.ARPA> <544@ucsfcgl.UUCP> <6085@ucla-cs.ARPA>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site uthub.UUCP Path: arc1-ca.pugleaf.net!utzoo!utcsri!utai!uthub!ron From: ron@uthub.UUCP (Ron Wessels) Newsgroups: net.games.hack Subject: Tainted meat [ Spoiler ] [ Possible bug fix ] Message-ID: <218@uthub.UUCP> Date: Wed, 26-Jun-85 21:18:37 EDT Article-I.D.: uthub.218 Posted: Wed Jun 26 21:18:37 1985 Date-Received: Wed, 26-Jun-85 22:26:52 EDT References: <6001@ucla-cs.ARPA> <544@ucsfcgl.UUCP> <6085@ucla-cs.ARPA> Organization: CSRG, University of Toronto Lines: 45