Mercury314
Chieftain
- Joined
- Sep 6, 2007
- Messages
- 43
Hey all,
I am writing some code in the SDK to disallow a certain Goody if a certain tech has been discovered (effectively disabling or enabling a Goody after a certain time).
To do this, I am using the following code in the
bool CvPlayer::canReceiveGoody(CvPlot* pPlot, GoodyTypes eGoody, CvUnit* pUnit) const
function, in the CvPlayer.cpp file. This is where a goody is checked for legallity (no experience for settlers, that sort of thing), so it seems the proper place.
Unfortunately this code always returns false instead of only when the team has the technology TECH_BLADE.
Does anyone know where the error lies?
I am writing some code in the SDK to disallow a certain Goody if a certain tech has been discovered (effectively disabling or enabling a Goody after a certain time).
To do this, I am using the following code in the
bool CvPlayer::canReceiveGoody(CvPlot* pPlot, GoodyTypes eGoody, CvUnit* pUnit) const
function, in the CvPlayer.cpp file. This is where a goody is checked for legallity (no experience for settlers, that sort of thing), so it seems the proper place.
Code:
if(eGoody == (GoodyTypes)GC.getInfoTypeForString("GOODY_HUNTER"))
{
if(GET_TEAM(getTeam()).isHasTech((TechTypes)GC.getInfoTypeForString("TECH_BLADE")))
{
return false;
}
}
Unfortunately this code always returns false instead of only when the team has the technology TECH_BLADE.
Does anyone know where the error lies?