summaryrefslogtreecommitdiffstats
path: root/logic/OneSixVersionBuilder.cpp
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-02-08 12:47:14 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-02-08 12:47:14 +0100
commit6d9819cccf3809edef2f6a1aeb0c6d01d6067501 (patch)
tree4ae2e25d34df2314df5685cfa029b4f5b0195888 /logic/OneSixVersionBuilder.cpp
parentac2f64f3373f37e4ba039d4395857f59ca7975af (diff)
downloadMultiMC-6d9819cccf3809edef2f6a1aeb0c6d01d6067501.tar
MultiMC-6d9819cccf3809edef2f6a1aeb0c6d01d6067501.tar.gz
MultiMC-6d9819cccf3809edef2f6a1aeb0c6d01d6067501.tar.lz
MultiMC-6d9819cccf3809edef2f6a1aeb0c6d01d6067501.tar.xz
MultiMC-6d9819cccf3809edef2f6a1aeb0c6d01d6067501.zip
Error if a patch file is for a different version of minecraft
Diffstat (limited to 'logic/OneSixVersionBuilder.cpp')
-rw-r--r--logic/OneSixVersionBuilder.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/logic/OneSixVersionBuilder.cpp b/logic/OneSixVersionBuilder.cpp
index 03555070..62a5ca43 100644
--- a/logic/OneSixVersionBuilder.cpp
+++ b/logic/OneSixVersionBuilder.cpp
@@ -538,6 +538,15 @@ struct VersionFile
void applyTo(OneSixVersion *version, bool &isError)
{
isError = true;
+ if (!version->id.isNull() && !mcVersion.isNull())
+ {
+ if (QRegExp(mcVersion, Qt::CaseInsensitive, QRegExp::Wildcard).indexIn(version->id) == -1)
+ {
+ QLOG_ERROR() << filename << "is for a different version of Minecraft";
+ return;
+ }
+ }
+
if (!id.isNull())
{
version->id = id;