Hi,

This is for a noob question (I think :P)

I try to add a virtual function to CBaseCombatWeapon

So I add this into the declaration of this class :

virtual int GetHudDisplay() const {
       return Clip1();
}


and, in my weapon, which is derivated from
class CWeaponFrag: public CBaseHLCombatWeapon {
public :
// something
int GetHudDiplay() const;
};

(CWeaponFrag -> CBaseHLCombatWeapon -> CBaseCombatWeapon )

When I debug this :
C_BaseCombatWeapon *weapon = player->GetActiveWeapon();
weapon->GetHudDisplay();

the debugger say that weapon is a C_WeaponFrag (so a CWeaponFrag, isn't
it ?) but the weapon use the function from CBaseCombatWeapon and not
CWeaponFrag, as I want. but why ? There is something that I don't
understand...

thanks






_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to