Re: [crossfire] Alchemy formulae file broken

2022-02-10 Thread Preston Crow

I pushed a fix to compute the total_chance at the end.

On 2022-02-10 02:09, Preston Crow wrote:
I was doing some testing, and I found several basic alchemy formulas 
never showed up in books (mercury, philosophical oil, and 
philosophical salt).  After a lot of digging, I found that this 
accounted for a chance of 30, and there are 30 chance-1 formulas near 
the end of the file that aren't getting added to the total correctly.  
This is because in recipe.c, it adds the chance to the total_chance 
when it reads the ingredients, but on those 30 formulas, the chance is 
listed in the file after the ingredients.


While we could say the bug is in the formula file for putting the 
entries in the wrong order, it would seem like the right fix is to 
change recipe.c to not care about the order.  I think trying to set 
the total_chance field as we parse the file is wrong, and we should 
scan the lists at the end to set the value.



___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire
IRC: http://crossfire.real-time.com/irc/index.html
Discord: http://crossfire.real-time.com/discord/index.html
Project Site: https://sourceforge.net/projects/crossfire/
Wiki: http://wiki.cross-fire.org/
Website: http://crossfire.real-time.com


[crossfire] Alchemy formulae file broken

2022-02-09 Thread Preston Crow
I was doing some testing, and I found several basic alchemy formulas 
never showed up in books (mercury, philosophical oil, and philosophical 
salt).  After a lot of digging, I found that this accounted for a chance 
of 30, and there are 30 chance-1 formulas near the end of the file that 
aren't getting added to the total correctly.  This is because in 
recipe.c, it adds the chance to the total_chance when it reads the 
ingredients, but on those 30 formulas, the chance is listed in the file 
after the ingredients.


While we could say the bug is in the formula file for putting the 
entries in the wrong order, it would seem like the right fix is to 
change recipe.c to not care about the order.  I think trying to set the 
total_chance field as we parse the file is wrong, and we should scan the 
lists at the end to set the value.


___
crossfire mailing list
crossfire@metalforge.org
http://mailman.metalforge.org/mailman/listinfo/crossfire
IRC: http://crossfire.real-time.com/irc/index.html
Discord: http://crossfire.real-time.com/discord/index.html
Project Site: https://sourceforge.net/projects/crossfire/
Wiki: http://wiki.cross-fire.org/
Website: http://crossfire.real-time.com