Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
Bing, AhrefsBot, Google

Members: 0
Guests: 46
Stats
Files
Topics
Posts
Members
Newest Member
488
3,789
19,632
596
Elwood

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » 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 12:17 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,685
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 >>