Error if a patch file is for a different version of minecraft

This commit is contained in:
Jan Dalheimer 2014-02-08 12:47:14 +01:00
parent ac2f64f337
commit 6d9819cccf

View File

@ -538,6 +538,15 @@ struct VersionFile
void applyTo(OneSixVersion *version, bool &isError) void applyTo(OneSixVersion *version, bool &isError)
{ {
isError = true; 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()) if (!id.isNull())
{ {
version->id = id; version->id = id;