Login
User Name:

Password:



Register

Forgot your password?
 I3 and IMC
Dec 26, 2024 3:27 am
By GatewaySysop
Hi - Clean SmaugFuss map/description issue..
Dec 15, 2024 7:29 pm
By Samson
AFKMud 2.2.4
Dec 10, 2024 4:09 pm
By Samson
Ubuntu 22.04.5 LTS
Dec 5, 2024 5:10 pm
By Remcon
SmaugFUSS 1.8/1.9
Nov 29, 2024 11:46 am
By Remcon
LOP 1.6
Author: Remcon
Submitted by: Remcon
SWFOTEFUSS 1.5.1
Author: Various
Submitted by: Samson
SWRFUSS 1.4.1
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.5
Author: Various
Submitted by: Samson
AFKMud 2.2.4
Author: AFKMud Team
Submitted by: Samson
Users Online
Bing

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
496
3,808
19,708
594
MaisieMacl

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