mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Minor code cleanup, logging improvements.
This commit is contained in:
+2
-10
@@ -108,16 +108,8 @@ namespace boss {
|
||||
}
|
||||
|
||||
void AddNonOverlapEdges(PluginGraph& graph) {
|
||||
//First find the position of the first non-master.
|
||||
boss::vertex_it vitFirstNonMaster, vit, vitend;
|
||||
for (boost::tie(vit, vitend) = boost::vertices(graph); vit != vitend; ++vit) {
|
||||
if (!graph[*vit].IsMaster()) {
|
||||
vitFirstNonMaster = vit;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Now add edges for all relationships that aren't overlaps.
|
||||
//Add edges for all relationships that aren't overlaps.
|
||||
boss::vertex_it vit, vitend;
|
||||
for (boost::tie(vit, vitend) = boost::vertices(graph); vit != vitend; ++vit) {
|
||||
vertex_t parentVertex;
|
||||
|
||||
|
||||
@@ -84,11 +84,11 @@ namespace boss {
|
||||
}
|
||||
|
||||
bool ConditionStruct::EvalCondition(boss::Game& game) const {
|
||||
BOOST_LOG_TRIVIAL(trace) << "Evaluating condition: " << _condition;
|
||||
|
||||
if (_condition.empty())
|
||||
return true;
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Evaluating condition: " << _condition;
|
||||
|
||||
boost::unordered_map<std::string, bool>::const_iterator it = game.conditionCache.find(boost::to_lower_copy(_condition));
|
||||
if (it != game.conditionCache.end())
|
||||
return it->second;
|
||||
@@ -276,9 +276,10 @@ namespace boss {
|
||||
file = new espm::fonv::File(filepath, game.espm_settings, false, headerOnly);
|
||||
|
||||
//If the name passed ends in '.ghost', that should be trimmed.
|
||||
BOOST_LOG_TRIVIAL(trace) << "Trimming '.ghost' extension.";
|
||||
if (boost::iends_with(name, ".ghost"))
|
||||
if (boost::iends_with(name, ".ghost")) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "Trimming '.ghost' extension.";
|
||||
name = name.substr(0, name.length() - 6);
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Checking to see if plugin is a master or not.";
|
||||
isMaster = file->isMaster(game.espm_settings);
|
||||
@@ -286,6 +287,8 @@ namespace boss {
|
||||
BOOST_LOG_TRIVIAL(trace) << "Getting the plugin's masters.";
|
||||
masters = file->getMasters();
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Number of masters: " << masters.size();
|
||||
|
||||
crc = file->crc;
|
||||
game.crcCache.insert(pair<string, uint32_t>(n, crc));
|
||||
|
||||
@@ -328,7 +331,7 @@ namespace boss {
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Attempting to extract Bash Tags from the description.";
|
||||
size_t pos1 = text.find("{{BASH:");
|
||||
if (pos1 == string::npos)
|
||||
if (pos1 == string::npos || pos1 + 7 == text.length())
|
||||
return;
|
||||
|
||||
pos1 += 7;
|
||||
|
||||
@@ -317,6 +317,7 @@ bool BossGUI::OnInit() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(debug) << "Game selected is " << _game.Name();
|
||||
|
||||
//Now that game is selected, initialise it.
|
||||
BOOST_LOG_TRIVIAL(debug) << "Initialising game-specific settings.";
|
||||
|
||||
Reference in New Issue
Block a user