From 163207e362dbd850e356d9e21051cc049958c5fb Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 30 Jun 2016 20:42:27 -0400 Subject: [PATCH] Give more feedback for DF detection failures with mismatched XML versions This may help address issues where people forget to read the documentation, don't run "git submodule update", and end up with a df-structures version that's too old (which is somewhat common, it turns out). --- library/Core.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/library/Core.cpp b/library/Core.cpp index f5bc9d4e7..fb1dd80bb 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -1485,7 +1485,34 @@ bool Core::Init() if(!vinfo || !p->isIdentified()) { - fatal("Not a known DF version.\n"); + if (!Version::git_xml_match()) + { + const char *msg = ( + "*******************************************************\n" + "* BIG, UGLY ERROR MESSAGE *\n" + "*******************************************************\n" + "\n" + "This DF version is missing from hack/symbols.xml, and\n" + "you have compiled DFHack with a df-structures (xml)\n" + "version that does *not* match the version tracked in git.\n" + "\n" + "If you are not actively working on df-structures and you\n" + "expected DFHack to work, you probably forgot to run\n" + "\n" + " git submodule update\n" + "\n" + "If this does not sound familiar, read Compile.rst and \n" + "recompile.\n" + "More details can be found in stderr.log in this folder.\n" + ); + cout << msg << endl; + cerr << msg << endl; + fatal("Not a known DF version - XML version mismatch (see console or stderr.log)"); + } + else + { + fatal("Not a known DF version.\n"); + } errorstate = true; delete p; p = NULL;