mirror of
https://github.com/glest/glest-source.git
synced 2025-08-30 11:19:48 +02:00
- bugfix for save / restore game (spelling mistake)
- vc++ warning fixes
This commit is contained in:
@@ -3136,7 +3136,7 @@ void ScriptManager::saveGame(XmlNode *rootNode) {
|
|||||||
XmlNode *unitTriggerEventListNode = scriptManagerNode->addChild("UnitTriggerEventList");
|
XmlNode *unitTriggerEventListNode = scriptManagerNode->addChild("UnitTriggerEventList");
|
||||||
|
|
||||||
unitTriggerEventListNode->addAttribute("unitId",intToStr(iterMap->first), mapTagReplacements);
|
unitTriggerEventListNode->addAttribute("unitId",intToStr(iterMap->first), mapTagReplacements);
|
||||||
unitTriggerEventListNode->addAttribute("evenType",intToStr(iterMap->second), mapTagReplacements);
|
unitTriggerEventListNode->addAttribute("eventType",intToStr(iterMap->second), mapTagReplacements);
|
||||||
}
|
}
|
||||||
scriptManagerNode->addAttribute("lastUnitTriggerEventUnitId",intToStr(lastUnitTriggerEventUnitId), mapTagReplacements);
|
scriptManagerNode->addAttribute("lastUnitTriggerEventUnitId",intToStr(lastUnitTriggerEventUnitId), mapTagReplacements);
|
||||||
scriptManagerNode->addAttribute("lastUnitTriggerEventType",intToStr(lastUnitTriggerEventType), mapTagReplacements);
|
scriptManagerNode->addAttribute("lastUnitTriggerEventType",intToStr(lastUnitTriggerEventType), mapTagReplacements);
|
||||||
@@ -3262,9 +3262,15 @@ void ScriptManager::loadGame(const XmlNode *rootNode) {
|
|||||||
for(unsigned int i = 0; i < unitTriggerEventListNodeList.size(); ++i) {
|
for(unsigned int i = 0; i < unitTriggerEventListNodeList.size(); ++i) {
|
||||||
XmlNode *node = unitTriggerEventListNodeList[i];
|
XmlNode *node = unitTriggerEventListNodeList[i];
|
||||||
|
|
||||||
|
UnitTriggerEventType eventType = utet_None;
|
||||||
int unitId = node->getAttribute("unitId")->getIntValue();
|
int unitId = node->getAttribute("unitId")->getIntValue();
|
||||||
UnitTriggerEventType evenType = static_cast<UnitTriggerEventType>(node->getAttribute("eventType")->getIntValue());
|
if(node->hasAttribute("eventType") == true) {
|
||||||
UnitTriggerEventList[unitId] = evenType;
|
eventType = static_cast<UnitTriggerEventType>(node->getAttribute("eventType")->getIntValue());
|
||||||
|
}
|
||||||
|
else if(node->hasAttribute("evenType") == true) {
|
||||||
|
eventType = static_cast<UnitTriggerEventType>(node->getAttribute("evenType")->getIntValue());
|
||||||
|
}
|
||||||
|
UnitTriggerEventList[unitId] = eventType;
|
||||||
}
|
}
|
||||||
if(scriptManagerNode->hasAttribute("lastUnitTriggerEventUnitId") == true) {
|
if(scriptManagerNode->hasAttribute("lastUnitTriggerEventUnitId") == true) {
|
||||||
lastUnitTriggerEventUnitId = scriptManagerNode->getAttribute("lastUnitTriggerEventUnitId")->getIntValue();
|
lastUnitTriggerEventUnitId = scriptManagerNode->getAttribute("lastUnitTriggerEventUnitId")->getIntValue();
|
||||||
|
@@ -780,7 +780,7 @@ bool XmlNode::hasChildNoSuper(const string &childName) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
XmlNode * XmlNode::getChildWithAliases(vector<string> childNameList, unsigned int childIndex) const {
|
XmlNode * XmlNode::getChildWithAliases(vector<string> childNameList, unsigned int childIndex) const {
|
||||||
for(int aliasIndex = 0; aliasIndex < childNameList.size(); ++aliasIndex) {
|
for(int aliasIndex = 0; aliasIndex < (int)childNameList.size(); ++aliasIndex) {
|
||||||
const string &childName = childNameList[aliasIndex];
|
const string &childName = childNameList[aliasIndex];
|
||||||
if(superNode && hasChildNoSuper(childName) == false) {
|
if(superNode && hasChildNoSuper(childName) == false) {
|
||||||
return superNode->getChild(childName,childIndex);
|
return superNode->getChild(childName,childIndex);
|
||||||
@@ -826,7 +826,7 @@ bool XmlNode::hasChild(const string &childName) const {
|
|||||||
|
|
||||||
bool XmlNode::hasChildWithAliases(vector<string> childNameList) const {
|
bool XmlNode::hasChildWithAliases(vector<string> childNameList) const {
|
||||||
bool result = false;
|
bool result = false;
|
||||||
for(int aliasIndex = 0; aliasIndex < childNameList.size(); ++aliasIndex) {
|
for(int aliasIndex = 0; aliasIndex < (int)childNameList.size(); ++aliasIndex) {
|
||||||
const string &childName = childNameList[aliasIndex];
|
const string &childName = childNameList[aliasIndex];
|
||||||
result = hasChild(childName);
|
result = hasChild(childName);
|
||||||
if(result == true) {
|
if(result == true) {
|
||||||
|
Reference in New Issue
Block a user