Login
User Name:

Password:



Register

Forgot your password?
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
SmaugFUSS 1.9.4
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.3
Author: Various
Submitted by: Samson
Users Online
CommonCrawl, AhrefsBot, SemrushBot, DotBot

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
486
3,758
19,453
572
Fjolsvith

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,665
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 >>