View Single Post
Old September 22, 2009, 05:15   #1
Sirridan
Knight
 
Sirridan's Avatar
 
Join Date: May 2009
Posts: 560
Sirridan is on a distinguished road
r1676 - Random Ability Bug on Ego

When getting egos, (Blessed), Lothlorien, and Magi, I seem to only get slow metabolism as the random ability, and random resists on gear (Aman / Preservation) give rPoison. Not that I mind the rpoison, I always seem to lack it... but yeah.

2 aman, 1 preservation both had rPoison, and at least 30 random ability egos or more were all slow metabolism.

Unless this was found and fixed in a later version?

EDIT:

Checked out the code, seems that rPoison and Slow Digest are both the first element of their ego_xtra arrays... is anything wrong with get_new_attr?

Code:
u32b get_new_attr(u32b flags, const u32b attrs[])
{
	size_t i;
	int options = 0;
	u32b flag = 0;
	for (i = 0; i < N_ELEMENTS(attrs); i++)
	{
		/* skip this one if the flag is already present */
		if (flags & attrs[i]) continue;

		/* each time we find a new possible option, we have a 1-in-N chance of
		 * choosing it and an (N-1)-in-N chance of keeping a previous one */
		if (one_in_(++options)) flag = attrs[i];
	}
	return flag;
}
looking at this, it should be 1 in 1 for poison, then 1 in 2 to change it to the next, and so on... but it always chooses poison. The code segment looks fine to me, unless one_in_(x) was changed recently?

More edits:

Also noticed for random sustains, it always picks strength, which is also first in the sustain list...

EVEN MORE EDITS OMG: One more elvenkind with rPoison...

Last edited by Sirridan; September 22, 2009 at 06:34.
Sirridan is offline   Reply With Quote