Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Bing

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
613
bastian
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » AFKMud Bugfix List » AFKMud Bug Archive » [Bug] Despair not protected a...
Forum Rules | Mark all | Recent Posts

[Bug] Despair not protected against targets who might flee the room
< Newer Topic :: Older Topic > AFKMud 1.64

Pages:<< prev 1 next >>
Post is unread #1 Jan 9, 2005, 12:59 pm   Last edited Nov 13, 2005, 11:58 am by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Despair spell is not protected against targets who might flee the room.
Discovered in: AFKMud 1.64
Danger: High - Potential data corruption + potential game crash.
Found by: Samson
Fixed by: Samson

---

magic.c, locate the following:

SPELLF spell_despair( int sn, int level, CHAR_DATA *ch, void *vo )
{
   CHAR_DATA *vch;
   bool despair = false;

   /*
    * Add check for proper bard instrument in future 
    */
   for( vch = ch->in_room->first_person; vch; vch = vch->next_in_room )
   {
      if( IS_NPC( vch ) )
         continue;

      if( !is_same_char_map( ch, vch ) )
         continue;
      else
      {
         if( saves_spell_staff( level, vch ) )
            continue;
         else
         {
            interpret( vch, "flee" );
            despair = true;
         }
      }
   }
   if( despair )
      send_to_char( "&[magic]Your magic strikes fear into the hearts of the occupants!\n\r", ch );
   else
      send_to_char( "&[magic]You weave your magic, but there was no noticable affect.\n\r", ch );
   return rNONE;
}


Replace with:

SPELLF spell_despair( int sn, int level, CHAR_DATA *ch, void *vo )
{
   CHAR_DATA *vch, *vch_next;
   bool despair = false;

   /*
    * Add check for proper bard instrument in future 
    */
   for( vch = ch->in_room->first_person; vch; vch = vch_next )
   {
      vch_next = vch->next_in_room;

      if( IS_NPC( vch ) )
         continue;

      if( !is_same_map( ch, vch ) )
         continue;
      else
      {
         if( saves_spell_staff( level, vch ) )
            continue;
         else
         {
            interpret( vch, "flee" );
            despair = true;
         }
      }
   }
   if( despair )
      send_to_char( "&[magic]Your magic strikes fear into the hearts of the occupants!\n\r", ch );
   else
      send_to_char( "&[magic]You weave your magic, but there was no noticable affect.\n\r", ch );
   return rNONE;
}


Another classic example. The spell can cause mobs to flee the room, which will result in their pointers being unlinked from the room.
       
Pages:<< prev 1 next >>