Calling a base class function

phungus420

Deity
Joined
Mar 1, 2003
Messages
6,296
I'm getting a "getStateReligion() is not a member of CvPlayerAI" from this call in a function in CvCityAI:

ReligionTypes eStateReligion = kPlayerAI.getPlayer().getStateRelgion();

using getPlayer() in CvCityAI returns a CvPlayerAI object. CvPlayerAI is a derivative class of CvPlayer (also CvCityAI is a derivative class of CvCity, but making calls to CvCity functions seems to work fine from inside CvCityAI), so how do I make a call to a public function in CvPlayer from inside CvCityAI?

Edit, nevermind. Firstly, it was a typo, so the call worked. Seconly you can do this as well:

CvPlayerAI& kPlayerAI = GET_PLAYER(getOwnerINLINE());
CvPlayer& kPlayer = GET_PLAYER(getOwnerINLINE());
 
Top Bottom