mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-07-02 22:14:37 +00:00
Fix possible crash on startup & disable newly added ActionSets by default
This commit is contained in:
parent
2fd181913e
commit
520239a845
1 changed files with 10 additions and 4 deletions
|
@ -477,11 +477,12 @@ void UserSettings::load(bool doApply, const std::string &overrideFile)
|
|||
|
||||
for(XMLElement *xml_action = xml_actionSet->FirstChildElement(); xml_action; xml_action = xml_action->NextSiblingElement())
|
||||
{
|
||||
std::string name = xml_action->Attribute("name");
|
||||
if (!name.empty())
|
||||
const char *name = xml_action->Attribute("name");
|
||||
const char *input = xml_action->Attribute("input");
|
||||
if (name && *name && input && *input)
|
||||
{
|
||||
ActionInput *ai = as.addActionInput(name);
|
||||
ai->fromString(xml_action->Attribute("input"));
|
||||
ai->fromString(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -490,7 +491,12 @@ void UserSettings::load(bool doApply, const std::string &overrideFile)
|
|||
if(nas < control.minActionSets)
|
||||
control.actionSets.resize(control.minActionSets);
|
||||
while(nas < control.actionSets.size())
|
||||
ensureDefaultActions(control.actionSets[nas++]);
|
||||
{
|
||||
ActionSet& as = control.actionSets[nas];
|
||||
ensureDefaultActions(as);
|
||||
as.enabled = false;
|
||||
++nas;
|
||||
}
|
||||
}
|
||||
|
||||
XMLElement *xml_demo = doc.FirstChildElement("Demo");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue