[CF-Devel] Bug report - The Divine Flower Bug

gros yann.chachkoff at mailandnews.com
Sun May 13 22:22:40 CDT 2001


Version: Current CVS version (0.98.0)

Problem: 
 Suppose player A is a follower of Mostrai, and B a follower of Sorig. B 
fails a priest casting and creates flowers all around. A takes some of these 
flowers and magically behaves like a follower of Sorig (can pray on Sorig 
altar but not on Mostrai's, gets Sorig's special stuff, etc) until dropping 
flowers or exiting the game (The divine flowers will never be saved).

Source:
 in gods.c, function determine_god: for players, the inventory is browsed 
until a 'divine' object is encountered. That object is the praying skill 90% 
of the time, but it may also be 'divine' flowers.

Proposed solution:
 Adding a skill check in the loop; the code:

    /* If we are player, lets search a bit harder for the god.  This
     * is a fix for perceive self (before, we just looked at the active
     * skill.)
     */
    if(op->type==PLAYER) {
	object *tmp;

	for (tmp=op->inv; tmp!=NULL; tmp=tmp->below) {
	    if (tmp->exp_obj && tmp->exp_obj->title)
		return tmp->exp_obj->title;
	}
    }

 will become:

    /* If we are player, lets search a bit harder for the god.  This
     * is a fix for perceive self (before, we just looked at the active
     * skill.)
     */
    if(op->type==PLAYER) {
	object *tmp;

	for (tmp=op->inv; tmp!=NULL; tmp=tmp->below) {
	    if (tmp->type == SKILL)
	    {
	    	if (tmp->exp_obj && tmp->exp_obj->title)
			return tmp->exp_obj->title;
	    }
	}
    }

 Note that the extra test should not slow the whole thing a lot, since for 
all non-skill objects, we only do one test.

Commander Gros
Ad Dwarvam Aeternam !

    
    


More information about the crossfire mailing list