View Single Post
  #11  
Old 07-14-2011, 04:54 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Quote:
Originally Posted by bad_captain View Post
When #Showstats is called, it is on a Mob*, not Bot*, which I believe causes it to call the Mob version of GetAC(). That version adds in item and spell AC, which has already been included in the AC value.
It sounds like you may not know how virtual functions work. Virtual means that no matter what type of pointer you have in a class hierarchy, calling a virtual function will call the most derived function available that matches the proper signature.

The GetAC function in the bot class doesn't match the signature of any virtual function in the base class, so it is never called as a virtual function. If the signature was corrected to match the base it would work just fine.
Reply With Quote