View Single Post
  #6  
Old 04-26-2016, 04:27 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

The thing with class Bot, it is derived from class NPC as well as class Mob (and class Entity..and...) .. so, some of the code may be in the other two classes.


You will probably see many cases like this:
Code:
Mob* mob_ptr = <some rvalue>;

mob_ptr->SomeVirtualFunction();
It's probable that the following are declared:
Code:
virtual void Mob::SomeVirtualFunction();

virtual void NPC::SomeVirtualFunction();

virtual void Bot::SomeVirtualFunction();
If <some rvalue> is instantiated as class Mob, then Mob::SomeVirtualFunction() is called.

If <some rvalue> is instantiated as class NPC, then NPC::SomeVirtualFunction() is called.

If <some rvalue> is instantiated as class Bot, then Bot::SomeVirtualFunction() is called.


Now, take away the class Bot virtual declaration:

If <some rvalue> is instantiated as class Bot, then NPC::SomeVirtualFunction() is called.


If you're using visual studio, it has some really good tools that can help.
__________________
Uleat of Bertoxxulous

Compilin' Dirty
Reply With Quote