Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
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
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Majestic-12, Yahoo!, Google, DotBot

Members: 0
Guests: 14
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SWFOTE FUSS Bugfix List » [Bug] Spell immunity checks a...
Forum Rules | Mark all | Recent Posts

[Bug] Spell immunity checks are not working properly
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Feb 19, 2006, 11:17 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Bug: Spell immunity checks are not working properly
Danger: Medium - Expected immunity may not work, or may report successful even when not set.
Found by: Matteo2303
Fixed by: Samson

---

magic.c, is_immune

Replace that function with this new one:
bool is_immune( CHAR_DATA *ch, short damtype )
{
   switch( damtype )
   {
      case SD_FIRE:           return( IS_SET( ch->immune, RIS_FIRE ) );
      case SD_COLD:           return( IS_SET( ch->immune, RIS_COLD ) );
      case SD_ELECTRICITY:    return( IS_SET( ch->immune, RIS_ELECTRICITY ) );
      case SD_ENERGY:         return( IS_SET( ch->immune, RIS_ENERGY ) );
      case SD_ACID:           return( IS_SET( ch->immune, RIS_ACID ) );
      case SD_POISON:         return( IS_SET( ch->immune, RIS_POISON ) );
      case SD_DRAIN:          return( IS_SET( ch->immune, RIS_DRAIN ) );
   }
   return FALSE;
}


The is_immune function checks for the immunity to types of spell damage. It is supposed to return TRUE upon a successul check, and FALSE if not. Apparently the way the original function worked the switch was able to fall through to something else and report a false positive if another immunity was present on the player. It is assumed that this could also have worked the other way. In either case, the above function fixes the issue by returning the direct result of the IS_SET macro, be it TRUE or FALSE. The above function was adapted from the AFKMud 2.0 C++ code. In addition to fixing the issue it is also visually easier to follow, and takes up fewer lines.
       
Pages:<< prev 1 next >>