function not a member of CvPlayerAI error...

Putmalk

Deity
Joined
Sep 26, 2010
Messages
2,652
Location
New York
I'm really confused...

CvLuaPlayer.cpp
Code:
//int GetScienceFromBudgetDeficitTimes100();
int CvLuaPlayer::lGetScienceFromBudgetDeficitTimes100(lua_State* L)
{
	return BasicLuaMethod(L, &CvPlayerAI::GetScienceFromBudgetDeficitTimes100);
}
//int GetScienceFromVassalsTimes100();
int CvLuaPlayer::lGetScienceFromVassalsTimes100(lua_State* L)
{
	return BasicLuaMethod(L, &CvPlayerAI::GetScienceFromVassalsTimes100);
}

First function written by firaxis. Second by me.

It's rather simple. Return the science modifier by having a vassal. They reference CvPlayerAI, I reference it, and I was confused because CvPlayerAI has no function called GetScienceFromBudgetDeficitTimes100, CvPlayer does.

Why on earth would the compiler accept GetScienceFromBudgetDeficitTimes100 and not GetScienceFromVassalsTimes100? Am I missing something? Is this some communication issue between LUA and C++? Because I'm lost and I don't want to let something as dumb as this get in the way of me completing this rather large project of mine.
 
Okay well I really hate that feeling when you post something looking for help and then you get the answer immediately right after...

Problem was a spelling error, in case someone gets it in the future. GetScienceFromVassalsTimes100 should have been GetScienceFromVassalTimes100...
 
They reference CvPlayerAI, I reference it, and I was confused because CvPlayerAI has no function called GetScienceFromBudgetDeficitTimes100, CvPlayer does.

Basic object inheritance

Code:
class CvPlayerAI : public CvPlayer
 
Back
Top Bottom