Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 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
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
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, Google, Yahoo!, DotBot

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » AFKMud Bugfix List » [Bug] Spec_fun names are assi...
Forum Rules | Mark all | Recent Posts

[Bug] Spec_fun names are assigned improperly when binding pets
< Newer Topic :: Older Topic > AFKMud 2.02

Pages:<< prev 1 next >>
Post is unread #1 Oct 14, 2007, 10: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: Spec_fun names are assigned improperly when binding pets
Danger: Unknown - There was no compiler warning or error, and nothing has triggered it in runtime so far.
Discovered in: AFKMud 2.02
Found by: Samson
Fixed by: Samson

---

character.cpp, char_data::set_specfun

Locate:
      case CLASS_PALADIN:
         spec_fun = m_spec_lookup( "spec_paladin" );
         spec_funname = STRALLOC( "spec_paladin" );
         break;

      case CLASS_DRUID:
         spec_fun = m_spec_lookup( "spec_druid" );
         spec_funname = STRALLOC( "spec_druid" );
         break;

      case CLASS_ANTIPALADIN:
         spec_fun = m_spec_lookup( "spec_antipaladin" );
         spec_funname = STRALLOC( "spec_antipaladin" );
         break;

      case CLASS_BARD:
         spec_fun = m_spec_lookup( "spec_bard" );
         spec_funname = STRALLOC( "spec_bard" );
         break;


Change to:
      case CLASS_PALADIN:
         this->spec_fun = m_spec_lookup( "spec_paladin" );
         this->spec_funname = "spec_paladin";
         break;

      case CLASS_DRUID:
         this->spec_fun = m_spec_lookup( "spec_druid" );
         this->spec_funname = "spec_druid";
         break;

      case CLASS_ANTIPALADIN:
         this->spec_fun = m_spec_lookup( "spec_antipaladin" );
         this->spec_funname = "spec_antipaladin";
         break;

      case CLASS_BARD:
         this->spec_fun = m_spec_lookup( "spec_bard" );
         this->spec_funname = "spec_bard";
         break;


The spec_funname member of char_data is a std::string and should not have been passed through the hash table for char* strings. However for some reason the compiler is not reporting a problem with this and it slipped by unnoticed. Since the effects of this are unknown at runtime, it's advisable to fix this.
       
Pages:<< prev 1 next >>