stolenrays
Deity
- Joined
- Aug 2, 2009
- Messages
- 2,063
So I am trying to convert some Total War Code. I keep getting a: SDK Error: Cannot convert from 'int *' to 'int'. Not sure what it means, but here is the function in CvGame.cpp & then below the CvGame.h initializations.
1>CvGame.cpp(3774) : error C2440: 'return' : cannot convert from 'int *' to 'int'
1> This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Code:
int CvGame::getProhibitedSpecialUnitCount(SpecialUnitTypes eIndex) const
{
FAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");
FAssertMsg(eIndex < GC.getNumSpecialUnitInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");
if (m_ppaaiAM[eIndex] == NULL)
{
return 0;
}
return m_ppaaiAM[eIndex];
}
1>CvGame.cpp(3774) : error C2440: 'return' : cannot convert from 'int *' to 'int'
1> This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Code:
int* m_ppaaiProhibitedSpecialUnitCount;
int** m_ppaaiAM;
int getProhibitedSpecialUnitCount(SpecialUnitTypes eIndex) const;