[CF-Devel] God's intervention: broken?

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Sat Oct 25 11:49:45 CDT 2003


Apparently god intervention, when praying at an altar, is broken.

Looking in the code, i found 2 things:
* in cast_heal (healing used when god decides to help you), the function will 
return 1 (success) even if nothing was done. From the code:

     if (spell->stats.hp)
	heal += random_roll(spell->stats.hp, 6, op, PREFER_HIGH) +
	    spell->stats.hp;

     if (tmp->stats.hp >= tmp->stats.maxhp && heal) {
	new_draw_info(NDI_UNIQUE, 0,tmp, "Your are already fully healed.");
     }
     else {
	/* See how many points we actually heal.  Instead of messages
	 * based on type of spell, we instead do messages based
	 * on amount of damage healed.
	 */
	if (heal > (tmp->stats.maxhp - tmp->stats.hp))
	    heal = tmp->stats.maxhp - tmp->stats.hp;

	tmp->stats.hp += heal;
	<snip>
	success=1;


If the spell is a cure confusion, heal == 0 thus the test doesn't return with 
'You are already fully healed'.
But the code, after that, just sets success = 1 even if heal is 0.
So even if the spell is cure confusion, this function will return 1 (success).

This prevents any other god present after that (for Gaea for instance, remove 
confusion is always given in case of intervention, so no other treasure will be 
given).
So the function should be fixed to correctly not set success = 1 if heal = 0

* second point, the 'spell direct' is checked with
         if (item->type == SPELL)
(gods.c:881)

Except archetypes for spelldirect are with a value of SPELLBOOK.
So the spell isn't granted.
Also, after getting the spell (got one by tweaking stuff), since the type is 
SPELLBOOK, spells doesn't get displayed in 'cast output, nor can you use it...

Those 2 things combined seem to prevent any god-given thingy...
Fixing on my local server seems to do the trick

Nicolas 'Ryo'


_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list