Alignment BUG!

BODE@juncol.juniata.edu
Date: 02/19/96


I think I have found the alignment problem that I asked about yesterday.  It
seems that in the latest beta version, they decided to do a new alignment
function like this:
        GET_ALIGNMENT(ch) += ((-GET_ALIGNMENT(vict) - GET_ALIGNMENT(ch)) >> 4);
This is simple, and on the surface it looks good, but if you substitute in
values for it, the error becomes obvious:
        GET_ALIGNMENT(ch) += ((-(-800) - (1000)) >> 4);
        GET_ALIGNMENT(ch) += (800 - 1000) >> 4;
	GET_ALIGNMENT(ch) += -200 >> 4;
	GET_ALIGNMENT(ch) += -12.5;
To summarize, if you are good, and you kill something evil, you become less
good!  What I did was this:
	GET_ALIGNMENT(ch) += ((-GET_ALIGNMENT(vict)) >> 4);
	if (GET_ALIGNMENT(ch) > 1000)
	  GET_ALIGNMENT(ch) = 1000;
	if (GET_ALIGNMENT(ch) < -1000)
	  GET_ALIGNMENT(ch) = -1000;
I think that fixes it(in a kludgey sorta way).  Any comments?

 ------------------------------------------------------------------------------
(    Wyatt J. Bode    |   Macintosh Specialist/Manager   |   Juniata College   )
(                    /      bode@juncol.juniata.edu       \                    )
 ------------------------------------------------------------------------------



This archive was generated by hypermail 2b30 : 12/07/00 PST