Also dieses C++ macht mich fertig!
Ich wollte jetzt Alphas ValidCivic Tag 1 zu 1 kopieren...
Hatte keine Fehler beim kompilieren.
Aber beim laden hatte ich wieder diesen
XML Error
Allocating zero or less memory in
CvXMLLoadUtility::setVariableListTagPair
Diesen Fehler hatte ich schon mal als ich versucht habe in der FeatureInfo den TechReveal Tag einzubauen.
Der Fehler war damals im TerrainSchema.
http://www.civforum.de/attachment.ph...7&d=1442471155
Die Lösung hat damals Kathy gefunden.
Edit: Die andere Möglichkeit ist, dass er durch die Änderung an dem Schema-Datei die gesamte TerrainInfos.xml nicht mehr laden kann und daher Ozean nicht finden. Da kommt mir eine Idee: Vielleicht liegt es daran, dass "TechReveal" zweimal definiert wurde, einmal für Feature und einmal für Bonus. Probier einmal, was passiert, wenn du diese Zeile
Code:
Code:
<ElementType name="TechReveal" content="textOnly"/>
1x entfernst, am besten die neue von dir.
Mein CivilizationChema sieht so aus, Alphas Teil...mein Teil.
Da ich mich an Kathys Lösung erinnerte, habe ich danach diesen CodeTeil
<ElementType name="bValid" content="textOnly" dt:type="boolean"/>
in meinen Teil gelöscht, ob mit oder ohne diesen Teil, Fehlermeldung.
Code:
</ElementType>
<ElementType name="FreeBuildingClasses" content="eltOnly">
<element type="FreeBuildingClass" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="TechType" content="textOnly"/>
<ElementType name="bFreeTech" content="textOnly" dt:type="boolean"/>
<ElementType name="FreeTech" content="eltOnly">
<element type="TechType"/>
<element type="bFreeTech"/>
</ElementType>
<ElementType name="FreeTechs" content="eltOnly">
<element type="FreeTech" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="bDisableTech" content="textOnly" dt:type="boolean"/>
<ElementType name="DisableTech" content="eltOnly">
<element type="TechType"/>
<element type="bDisableTech"/>
</ElementType>
<ElementType name="DisableTechs" content="eltOnly">
<element type="DisableTech" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="CivicType" content="textOnly"/>
<ElementType name="InitialCivics" content="eltOnly">
<element type="CivicType" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="bValid" content="textOnly" dt:type="boolean"/>
<ElementType name="ValidCivic" content="eltOnly">
<element type="CivicType"/>
<element type="bValid"/>
</ElementType>
<ElementType name="ValidCivics" content="eltOnly">
<element type="ValidCivic" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="ValidReligion" content="eltOnly">
<element type="ReligionType"/>
<element type="bValid"/>
</ElementType>
<ElementType name="ValidReligions" content="eltOnly">
<element type="ValidReligion" minOccurs="0" maxOccurs="*"/>
</ElementType>
<ElementType name="AnarchyCivics" content="eltOnly">
<element type="CivicType" minOccurs="0" maxOccurs="*"/>
</ElementType>
Code:
<ElementType name="CivilizationInfo" content="eltOnly">
<element type="Type"/>
<element type="Description"/>
<!-- Added for Planetfall -->
<element type="SpawningTech" minOccurs="0"/>
<element type="bAquatic" minOccurs="0"/>
<element type="bCharter" minOccurs="0"/>
<element type="bExpansion" minOccurs="0"/>
<element type="bFanExpansion" minOccurs="0"/>
<element type="bIsolated" minOccurs="0"/>
<element type="bPluralName" minOccurs="0"/>
<element type="bProgenitor" minOccurs="0"/>
<element type="iCityPlanet" minOccurs="0"/> <!-- Extra + or - planet that this civilization gets at all their cities-->
<element type="iMinEra" minOccurs="0"/>
<element type="Title" minOccurs="0"/>
<element type="CharacterGoodAdjective" minOccurs="0"/>
<element type="CharacterBadAdjective" minOccurs="0"/>
<element type="FollowerGoodAdjective" minOccurs="0"/>
<element type="FollowerBadAdjective" minOccurs="0"/>
<element type="ToCarryOutMission" minOccurs="0"/>
<element type="GoodActivityIsAre" minOccurs="0"/>
<element type="BadActivityIsAre" minOccurs="0"/>
<element type="BadHabits" minOccurs="0"/>
<element type="Insult" minOccurs="0"/>
<!-- End Added for Planetfall -->
<element type="ShortDescription"/>
<element type="Adjective"/>
<element type="Civilopedia"/>
<element type="DefaultPlayerColor"/>
<element type="ArtDefineTag"/>
<element type="ArtStyleType"/>
<element type="UnitArtStyleType" minOccurs="0" maxOccurs="1"/>
<element type="bPlayable"/>
<element type="bAIPlayable"/>
<element type="Cities"/>
<element type="SeaBases" minOccurs="0"/>
<element type="Buildings"/>
<element type="Units"/>
<element type="FreeUnitClasses"/>
<element type="FreeBuildingClasses"/>
<element type="FreeTechs"/>
<element type="DisableTechs"/>
<element type="InitialCivics"/>
<element type="ValidCivics"/>
<element type="ValidReligions"/>
<element type="AnarchyCivics" minOccurs="0"/>
<element type="Leaders" minOccurs="0"/>
<element type="DerivativeCiv"/>
<element type="CivilizationSelectionSound"/>
<element type="CivilizationActionSound"/>
</ElementType>
<ElementType name="CivilizationInfos" content="eltOnly">
<element type="CivilizationInfo" maxOccurs="*"/>
</ElementType>
in der civilizationinfo sieht es so aus.
Code:
<InitialCivics>
<CivicType>CIVIC_MISSION_COMMAND</CivicType>
<CivicType>CIVIC_SUBSISTENCE</CivicType>
<CivicType>CIVIC_SURVIVAL</CivicType>
<CivicType>CIVIC_NONE</CivicType>
<CivicType>CIVIC_NO_MEMBER</CivicType>
</InitialCivics>
<ValidCivics>
<ValidCivic>
<CivicType>CIVIC_GUIDING_MIND</CivicType>
<bValid>0</bValid>
</ValidCivic>
</ValidCivics>
<ValidReligions>
<ValidReligion>
<ReligionType>RELIGION_ECHO</ReligionType>
<bValid>0</bValid>
</ValidReligion>
</ValidReligions>
<Leaders>
<Leader>
<LeaderName>LEADER_WELLEN</LeaderName>
<bLeaderAvailability>1</bLeaderAvailability>
</Leader>
</Leaders>
CvInfo.h
Code:
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// class : CvCivilizationInfo
//
// DESC:
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class CvArtInfoCivilization;
class CvCivilizationInfo :
public CvInfoBase
{
//---------------------------------------PUBLIC INTERFACE---------------------------------
public:
DllExport CvCivilizationInfo();
DllExport virtual ~CvCivilizationInfo();
DllExport virtual void reset();
DllExport int getDefaultPlayerColor() const; // Expose to Python
DllExport int getArtStyleType() const; // Expose to Python
DllExport int getUnitArtStyleType() const; // Expose to Python
DllExport int getNumCityNames() const; // Expose to Python
DllExport int getNumLeaders() const; // Exposed to Python - the number of leaders the Civ has, this is needed so that random leaders can be generated easily
DllExport int getSelectionSoundScriptId() const; // Expose to Python
DllExport int getActionSoundScriptId() const; // Expose to Python
DllExport bool isAIPlayable() const; // Expose to Python
DllExport bool isPlayable() const; // Expose to Python
std::wstring pyGetShortDescription(uint uiForm) { return getShortDescription(uiForm); } // Exposed to Python
DllExport const wchar* getShortDescription(uint uiForm = 0);
DllExport const wchar* getShortDescriptionKey() const; // Exposed to Python
std::wstring pyGetShortDescriptionKey() { return getShortDescriptionKey(); } // Exposed to Python
std::wstring pyGetAdjective(uint uiForm) { return getAdjective(uiForm); } // Exposed to Python
DllExport const wchar* getAdjective(uint uiForm = 0);
DllExport const wchar* getAdjectiveKey() const; // Exposed to Python
std::wstring pyGetAdjectiveKey() { return getAdjectiveKey(); } // Exposed to Python
DllExport const TCHAR* getFlagTexture() const;
DllExport const TCHAR* getArtDefineTag() const;
DllExport void setArtDefineTag(const TCHAR* szVal);
// Arrays
DllExport int getCivilizationBuildings(int i) const; // Exposed to Python
DllExport int getCivilizationUnits(int i) const; // Exposed to Python
DllExport int getCivilizationFreeUnitsClass(int i) const; // Exposed to Python
DllExport int getCivilizationInitialCivics(int i) const; // Exposed to Python
//Versuch
DllExport bool isValidCivic(int i) const;
DllExport bool isValidReligion(int i) const;
//Versuch
DllExport bool isLeaders(int i) const; // Exposed to Python
Code:
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// class : CvCivilizationInfo
//
// DESC:
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class CvArtInfoCivilization;
class CvCivilizationInfo :
public CvInfoBase
{
//---------------------------------------PUBLIC INTERFACE---------------------------------
public:
DllExport CvCivilizationInfo();
DllExport virtual ~CvCivilizationInfo();
DllExport virtual void reset();
DllExport int getDefaultPlayerColor() const; // Expose to Python
DllExport int getArtStyleType() const; // Expose to Python
DllExport int getUnitArtStyleType() const; // Expose to Python
DllExport int getNumCityNames() const; // Expose to Python
DllExport int getNumLeaders() const; // Exposed to Python - the number of leaders the Civ has, this is needed so that random leaders can be generated easily
DllExport int getSelectionSoundScriptId() const; // Expose to Python
DllExport int getActionSoundScriptId() const; // Expose to Python
DllExport bool isAIPlayable() const; // Expose to Python
DllExport bool isPlayable() const; // Expose to Python
std::wstring pyGetShortDescription(uint uiForm) { return getShortDescription(uiForm); } // Exposed to Python
DllExport const wchar* getShortDescription(uint uiForm = 0);
DllExport const wchar* getShortDescriptionKey() const; // Exposed to Python
std::wstring pyGetShortDescriptionKey() { return getShortDescriptionKey(); } // Exposed to Python
std::wstring pyGetAdjective(uint uiForm) { return getAdjective(uiForm); } // Exposed to Python
DllExport const wchar* getAdjective(uint uiForm = 0);
DllExport const wchar* getAdjectiveKey() const; // Exposed to Python
std::wstring pyGetAdjectiveKey() { return getAdjectiveKey(); } // Exposed to Python
DllExport const TCHAR* getFlagTexture() const;
DllExport const TCHAR* getArtDefineTag() const;
DllExport void setArtDefineTag(const TCHAR* szVal);
// Arrays
DllExport int getCivilizationBuildings(int i) const; // Exposed to Python
DllExport int getCivilizationUnits(int i) const; // Exposed to Python
DllExport int getCivilizationFreeUnitsClass(int i) const; // Exposed to Python
DllExport int getCivilizationInitialCivics(int i) const; // Exposed to Python
//Versuch
DllExport bool isValidCivic(int i) const;
DllExport bool isValidReligion(int i) const;
//Versuch
DllExport bool isLeaders(int i) const; // Exposed to Python
CvInfo.cpp
Code:
//======================================================================================================
// CvCivilizationInfo
//======================================================================================================
//------------------------------------------------------------------------------------------------------
//
// FUNCTION: CvCivilizationInfo()
//
// PURPOSE : Default constructor
//
//------------------------------------------------------------------------------------------------------
CvCivilizationInfo::CvCivilizationInfo():
m_iDefaultPlayerColor(NO_PLAYERCOLOR),
m_iArtStyleType(NO_ARTSTYLE),
m_iUnitArtStyleType(NO_UNIT_ARTSTYLE),
m_iNumCityNames(0),
m_iNumLeaders(0),
m_iSelectionSoundScriptId(0),
m_iActionSoundScriptId(0),
m_iDerivativeCiv(NO_CIVILIZATION),
m_bPlayable(false),
m_bAIPlayable(false),
m_piCivilizationBuildings(NULL),
m_piCivilizationUnits(NULL),
m_piCivilizationFreeUnitsClass(NULL),
m_piCivilizationInitialCivics(NULL),
//Versuch
m_pbValidCivics(NULL),
m_pbValidReligions(NULL),
//Versuch
m_pbLeaders(NULL),
Code:
//------------------------------------------------------------------------------------------------------
//
// FUNCTION: ~CvCivilizationInfo()
//
// PURPOSE : Default destructor
//
//------------------------------------------------------------------------------------------------------
CvCivilizationInfo::~CvCivilizationInfo()
{
SAFE_DELETE_ARRAY(m_piCivilizationBuildings);
SAFE_DELETE_ARRAY(m_piCivilizationUnits);
SAFE_DELETE_ARRAY(m_piCivilizationFreeUnitsClass);
SAFE_DELETE_ARRAY(m_piCivilizationInitialCivics);
//Versuch
SAFE_DELETE_ARRAY(m_pbValidCivics);
SAFE_DELETE_ARRAY(m_pbValidReligions);
//Versuch
SAFE_DELETE_ARRAY(m_pbLeaders);
Code:
// Arrays
int CvCivilizationInfo::getCivilizationBuildings(int i) const
{
FAssertMsg(i < GC.getNumBuildingClassInfos(), "Index out of bounds");
FAssertMsg(i > -1, "Index out of bounds");
return m_piCivilizationBuildings ? m_piCivilizationBuildings[i] : -1;
}
int CvCivilizationInfo::getCivilizationUnits(int i) const
{
FAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds");
FAssertMsg(i > -1, "Index out of bounds");
return m_piCivilizationUnits ? m_piCivilizationUnits[i] : -1;
}
int CvCivilizationInfo::getCivilizationFreeUnitsClass(int i) const
{
FAssertMsg(i < GC.getNumUnitClassInfos(), "Index out of bounds");
FAssertMsg(i > -1, "Index out of bounds");
return m_piCivilizationFreeUnitsClass ? m_piCivilizationFreeUnitsClass[i] : -1;
}
int CvCivilizationInfo::getCivilizationInitialCivics(int i) const
{
FAssertMsg(i < GC.getNumCivicOptionInfos(), "Index out of bounds");
FAssertMsg(i > -1, "Index out of bounds");
return m_piCivilizationInitialCivics ? m_piCivilizationInitialCivics[i] : -1;
}
//Versuch
bool CvCivilizationInfo::isValidCivic(int i) const
{
FAssertMsg(i < GC.getNumCivicOptionInfos(), "Index out of bounds");
FAssertMsg(i > -1, "Index out of bounds");
return m_pbValidCivics ? m_pbValidCivics[i] : -1;
}
bool CvCivilizationInfo::isValidReligion(int i) const
{
FAssertMsg(i < GC.getNumReligionOptionInfos(), "Index out of bounds");
FAssertMsg(i > -1, "Index out of bounds");
return m_pbValidReligions ? m_pbValidReligions[i] : -1;
}
//Versuch
bool CvCivilizationInfo::isLeaders(int i) const
{
FAssertMsg(i < GC.getNumLeaderHeadInfos(), "Index out of bounds");
FAssertMsg(i > -1, "Index out of bounds");
return m_pbLeaders ? m_pbLeaders[i] : false;
}
Code:
// Arrays
SAFE_DELETE_ARRAY(m_piCivilizationBuildings);
m_piCivilizationBuildings = new int[GC.getNumBuildingClassInfos()];
stream->Read(GC.getNumBuildingClassInfos(), m_piCivilizationBuildings);
SAFE_DELETE_ARRAY(m_piCivilizationUnits);
m_piCivilizationUnits = new int[GC.getNumUnitClassInfos()];
stream->Read(GC.getNumUnitClassInfos(), m_piCivilizationUnits);
SAFE_DELETE_ARRAY(m_piCivilizationFreeUnitsClass);
m_piCivilizationFreeUnitsClass = new int[GC.getNumUnitClassInfos()];
stream->Read(GC.getNumUnitClassInfos(), m_piCivilizationFreeUnitsClass);
SAFE_DELETE_ARRAY(m_piCivilizationInitialCivics);
m_piCivilizationInitialCivics = new int[GC.getNumCivicOptionInfos()];
stream->Read(GC.getNumCivicOptionInfos(), m_piCivilizationInitialCivics);
//Versuch
SAFE_DELETE_ARRAY(m_pbValidCivics);
m_pbValidCivics = new bool[GC.getNumCivicInfos()];
stream->Read(GC.getNumCivicInfos(), m_pbValidCivics);
SAFE_DELETE_ARRAY(m_pbValidReligions);
m_pbValidReligions = new bool[GC.getNumReligionInfos()];
stream->Read(GC.getNumReligionInfos(), m_pbValidReligions);
//Versuch
SAFE_DELETE_ARRAY(m_pbLeaders);
m_pbLeaders = new bool[GC.getNumLeaderHeadInfos()];
stream->Read(GC.getNumLeaderHeadInfos(), m_pbLeaders);
Code:
// Arrays
stream->Write(GC.getNumBuildingClassInfos(), m_piCivilizationBuildings);
stream->Write(GC.getNumUnitClassInfos(), m_piCivilizationUnits);
stream->Write(GC.getNumUnitClassInfos(), m_piCivilizationFreeUnitsClass);
stream->Write(GC.getNumCivicOptionInfos(), m_piCivilizationInitialCivics);
//Versuch
stream->Write(GC.getNumCivicInfos(), m_pbValidCivics);
stream->Write(GC.getNumReligionInfos(), m_pbValidReligions);
//Versuch
stream->Write(GC.getNumLeaderHeadInfos(), m_pbLeaders);
Code:
bool CvCivilizationInfo::read(CvXMLLoadUtility* pXML)
{
char szClassVal[256]; // holds the text value of the relevant classinfo
CvString szTextVal;
if (!CvInfoBase::read(pXML))
{
return false;
}
int j, iNumSibs;
pXML->GetChildXmlValByName(m_szShortDescriptionKey, "ShortDescription");
// Get the Text from Text/Civ4GameTextXML.xml
pXML->GetChildXmlValByName(m_szAdjectiveKey, "Adjective");
// Get the Text from Text/Civ4GameTextXML.xml
pXML->GetChildXmlValByName(szTextVal, "DefaultPlayerColor");
m_iDefaultPlayerColor = pXML->FindInInfoClass(szTextVal);
pXML->GetChildXmlValByName(szTextVal, "ArtDefineTag");
setArtDefineTag(szTextVal);
pXML->GetChildXmlValByName(szTextVal, "ArtStyleType");
m_iArtStyleType = GC.getTypesEnum(szTextVal);
pXML->GetChildXmlValByName(szTextVal, "UnitArtStyleType");
m_iUnitArtStyleType = pXML->FindInInfoClass(szTextVal);
pXML->GetChildXmlValByName(szTextVal, "CivilizationSelectionSound");
m_iSelectionSoundScriptId = (szTextVal.GetLength() > 0) ? gDLL->getAudioTagIndex( szTextVal.GetCString(), AUDIOTAG_3DSCRIPT ) : -1;
pXML->GetChildXmlValByName(szTextVal, "CivilizationActionSound");
m_iActionSoundScriptId = (szTextVal.GetLength() > 0) ? gDLL->getAudioTagIndex( szTextVal.GetCString(), AUDIOTAG_3DSCRIPT ) : -1;
// set the current xml node to it's next sibling and then
pXML->GetChildXmlValByName(&m_bPlayable, "bPlayable");
pXML->GetChildXmlValByName(&m_bAIPlayable, "bAIPlayable");
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"Cities"))
{
pXML->SetStringList(&m_paszCityNames, &m_iNumCityNames);
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
// if we can set the current xml node to it's next sibling
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"Buildings"))
{
// pXML->Skip any comments and stop at the next value we might want
if (pXML->SkipToNextVal())
{
// call the function that sets the default civilization buildings
pXML->InitBuildingDefaults(&m_piCivilizationBuildings);
// get the total number of children the current xml node has
iNumSibs = gDLL->getXMLIFace()->GetNumChildren(pXML->GetXML());
// if the call to the function that sets the current xml node to it's first non-comment
// child and sets the parameter with the new node's value succeeds
if ( (0 < iNumSibs) && (gDLL->getXMLIFace()->SetToChild(pXML->GetXML())) )
{
int iBuildingClassIndex;
FAssertMsg((iNumSibs <= GC.getNumBuildingClassInfos()) ,"In SetGlobalCivilizationInfo iNumSibs is greater than GC.getNumBuildingClassInfos()");
// loop through all the siblings
for (j=0;j<iNumSibs;j++)
{
if (pXML->GetChildXmlVal(szClassVal))
{
// get the index into the array based on the building class type
iBuildingClassIndex = pXML->FindInInfoClass(szClassVal);
if (-1 < iBuildingClassIndex)
{
// get the next value which should be the building type to set this civilization's version of this building class too
pXML->GetNextXmlVal( szTextVal);
// call the find in list function to return either -1 if no value is found
// or the index in the list the match is found at
m_piCivilizationBuildings[iBuildingClassIndex] = pXML->FindInInfoClass(szTextVal);
}
else
{
FAssertMsg(0,"BuildingClass index is -1 in SetGlobalCivilizationInfo function");
}
// set the current xml node to it's parent node
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
// if the call to the function that sets the current xml node to it's first non-comment
// sibling and sets the parameter with the new node's value does not succeed
// we will break out of this for loop
if (!gDLL->getXMLIFace()->NextSibling(pXML->GetXML()))
{
break;
}
}
// set the current xml node to it's parent node
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
}
// set the current xml node to it's parent node
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
// if we can set the current xml node to it's next sibling
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"Units"))
{
// pXML->Skip any comments and stop at the next value we might want
if (pXML->SkipToNextVal())
{
// call the function that sets the default civilization buildings
pXML->InitUnitDefaults(&m_piCivilizationUnits);
// get the total number of children the current xml node has
iNumSibs = gDLL->getXMLIFace()->GetNumChildren(pXML->GetXML());
// if the call to the function that sets the current xml node to it's first non-comment
// child and sets the parameter with the new node's value succeeds
if ( (0 < iNumSibs) && (gDLL->getXMLIFace()->SetToChild(pXML->GetXML())) )
{
int iUnitClassIndex;
FAssertMsg((iNumSibs <= GC.getNumUnitClassInfos()),"In SetGlobalCivilizationInfo iNumSibs is greater than GC.getNumUnitClassInfos()");
// loop through all the siblings
for (j=0;j<iNumSibs;j++)
{
if (pXML->GetChildXmlVal(szClassVal))
{
// set the unit class index
iUnitClassIndex = pXML->FindInInfoClass(szClassVal);
if (-1 < iUnitClassIndex)
{
// get the next value which should be the building type to set this civilization's version of this building class too
pXML->GetNextXmlVal( szTextVal);
// call the find in list function to return either -1 if no value is found
// or the index in the list the match is found at
m_piCivilizationUnits[iUnitClassIndex] = pXML->FindInInfoClass(szTextVal);
}
else
{
FAssertMsg(0, "UnitClass index is -1 in SetGlobalCivilizationInfo function");
}
// set the current xml node to it's parent node
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
// if the call to the function that sets the current xml node to it's first non-comment
// sibling and sets the parameter with the new node's value does not succeed
// we will break out of this for loop
if (!gDLL->getXMLIFace()->NextSibling(pXML->GetXML()))
{
break;
}
}
// set the current xml node to it's parent node
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
}
// set the current xml node to it's parent node
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
pXML->SetVariableListTagPair(&m_piCivilizationFreeUnitsClass, "FreeUnitClasses", sizeof(GC.getUnitClassInfo((UnitClassTypes)0)), GC.getNumUnitClassInfos());
pXML->SetVariableListTagPair(&m_pbCivilizationFreeBuildingClass, "FreeBuildingClasses", sizeof(GC.getBuildingClassInfo((BuildingClassTypes)0)), GC.getNumBuildingClassInfos());
pXML->SetVariableListTagPair(&m_pbCivilizationFreeTechs, "FreeTechs", sizeof(GC.getTechInfo((TechTypes)0)), GC.getNumTechInfos());
pXML->SetVariableListTagPair(&m_pbCivilizationDisableTechs, "DisableTechs", sizeof(GC.getTechInfo((TechTypes)0)), GC.getNumTechInfos());
if (gDLL->getXMLIFace()->SetToChildByTagName(pXML->GetXML(),"InitialCivics"))
{
if (pXML->SkipToNextVal())
{
iNumSibs = gDLL->getXMLIFace()->GetNumChildren(pXML->GetXML());
pXML->InitList(&m_piCivilizationInitialCivics, GC.getNumCivicOptionInfos());
if (0 < iNumSibs)
{
if (pXML->GetChildXmlVal(szTextVal))
{
FAssertMsg((iNumSibs <= GC.getNumCivicOptionInfos()),"For loop iterator is greater than array size");
for (j=0;j<iNumSibs;j++)
{
m_piCivilizationInitialCivics[j] = pXML->FindInInfoClass(szTextVal);
if (!pXML->GetNextXmlVal(szTextVal))
{
break;
}
}
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
}
}
gDLL->getXMLIFace()->SetToParent(pXML->GetXML());
}
//Versuch
pXML->SetVariableListTagPair(&m_pbValidCivics, "ValidCivics", sizeof(GC.getCivicInfo((CivicTypes)0)), GC.getNumCivicInfos(), true);
pXML->SetVariableListTagPair(&m_pbValidReligions, "ValidReligions", sizeof(GC.getReligionInfo((ReligionTypes)0)), GC.getNumReligionInfos(), true);
//Versuch
pXML->SetVariableListTagPair(&m_pbLeaders, "Leaders", sizeof(GC.getLeaderHeadInfo((LeaderHeadTypes)0)), GC.getNumLeaderHeadInfos());
ich glaube ich bin zu nass für paste and copy.