[crossfire] Curse bug

Nicolas Weeger (Laposte) nicolas.weeger at laposte.net
Sat Dec 2 12:04:57 CST 2006


Reading fix_object (former fix_player), it seems to be there's a big mess 
waiting to happen (or already happened?) :)

Basically, fix_object resets many many things, including all special flags 
(see in dark, stealth, ...), resistances, ...
This means all those custom values will simply disappear whenever a monster 
will drink a potion, be hit by a curse or a disease, things like that :)
Of course fix_object works fine when called with a player, but will horribly 
alter things for a customized monster.

I can see a few possible fixes:
* fix fix_object so it handles things correctly
* don't call fix_object except when absolutely required. Recode eg curse to 
simply decrease wc, and restore it later when the force expires. Of course 
it's a mess with other things modifying wc
* we could store all modified values so fix_object knows what to search for. 
An overkill solution is to temporarily create an artifact for each customized 
monster, and free it when monster diseappears.


At first glance, I'd say we should create a temporarily artifact. It's the 
only way to be totally and definitely sure we never have any issue and keep 
all intended values - after all, at some point monsters will drink potions, 
or wear armor, or whatever.



What do you think?

Nicolas



More information about the crossfire mailing list