an error when loading CvTraitInfo

Joined
Feb 6, 2006
Messages
796
I added a new node in the TraitInfo, allowing to specify an improvement to receive a yield bonus (eg, if a tile contains a farm, the tile receives an extra food). In the XML, this info is represented using couple of nodes (like the ImprovementFreeSpecialists node for buildings).

In the CvInfos.cpp, in the "read" method, I added the following line:

pXML->SetVariableListTagPair(&m_paExtraYieldImprovements, "ImprovedTilesExtraYieldBonuses", sizeof(GC.getImprovementInfo((ImprovementTypes)0)), GC.getNumImprovementInfos());

I receive an error: cannot allocate zero or negative bytes.
Can it mean that, when this code is executed, the Improvements array has not been loaded yet?
How can I fix this?
 
Back
Top Bottom