Permalink
Browse files

NOISSUE change behaviour of the +tweakers patch item

Patch application will either add tweakers, or move them
to the end if they are already present.

This allows fixing up tweaker order in subsequent version patches.
  • Loading branch information...
peterix committed Oct 8, 2017
1 parent b882069 commit eba8e61ce99577ab34f1164eabded1581742ef7b
Showing with 11 additions and 4 deletions.
  1. +11 −4 api/logic/minecraft/MinecraftProfile.cpp
@@ -428,12 +428,19 @@ void MinecraftProfile::applyTraits(const QSet<QString>& traits)
void MinecraftProfile::applyTweakers(const QStringList& tweakers)
{
// FIXME: check for dupes?
// FIXME: does order matter?
for (auto tweaker : tweakers)
// if the applied tweakers override an existing one, skip it. this effectively moves it later in the sequence
QStringList newTweakers;
for(auto & tweaker: m_tweakers)
{
this->m_tweakers += tweaker;
if (tweakers.contains(tweaker))
{
continue;
}
newTweakers.append(tweaker);
}
// then just append the new tweakers (or moved original ones)
newTweakers += tweakers;
m_tweakers = newTweakers;
}
void MinecraftProfile::applyJarMods(const QList<LibraryPtr>& jarMods)

0 comments on commit eba8e61

Please sign in to comment.