[net.games.hack] Possible bug in hack

ryan@ucla-cs.UUCP (01/21/85)

Has anyone ever had a problem with a players strength going down
to -128 around level 24 or so
if you have please post on how this problem is fixed..
It has somthng to do withthe strength going past 18/**

thanks in advance

		ryan

lydgate@reed.UUCP (Chris Lydgate) (01/22/85)

In article <3338@ucla-cs.ARPA> ryan@ucla-cs.UUCP writes:
>Has anyone ever had a problem with a players strength going down
>to -128 around level 24 or so
>if you have please post on how this problem is fixed..
>It has somthng to do withthe strength going past 18/**

Yes, it happened to me, too. I didn't realize it, though,
until I had dropped all my magic, trying to lighten my load.
I'm using the WIZARD option, and every time I die my strength
goes up two. So after dying 64 times, I should be able to move
again.

		Chris Lydgate

play@turing.UUCP (01/23/85)

In article <3338@ucla-cs.ARPA> ryan@ucla-cs.UUCP writes:
>Has anyone ever had a problem with a players strength going down
>to -128 around level 24 or so
>if you have please post on how this problem is fixed..
>It has somthng to do withthe strength going past 18/**
>

Probably you were playing as WIZARD (i.e., hack -w). That is a
debugging mode (I should have taken it out before posting the
sources) and peculiar things might happen when you use it.
(For instance, in this particular case, what happens is that the
players strength is a signed character and lies in the range -1 .. 118.
However, if you die as a WIZARD your strength is incremented; if this
happens often enough it will go from 127 to -128.)
I do not regard this as a bug - it is like your weapon exploding when
you enchant it too much - but I will do something about it in the
next release.

jona@clyde.UUCP (Jon Allingham) (01/23/85)

> Has anyone ever had a problem with a players strength going down
> to -128 around level 24 or so
> if you have please post on how this problem is fixed..
> It has somthng to do withthe strength going past 18/**

strength is only an 8 bit number and if you increase your strength
to much you'll cause it to wrap around and become negative.

In the code, there is a check for strength == 118 , it should
probably ( but I haven't tried it ) be strength >= 118 to keep
from incrementing into the negative.

One solution is to stop quaffing potions of gain strength and don't
eat any tins of spinach once your strength is ** since it won't get
much better.


-- 
Jon M. Allingham	(201)386-3466	AT&T Bell Laboratories-WH

"Beam me up Scotty, no intelligent life down here!"