From: Daniel Karbach Date: Sat, 15 Sep 2012 20:12:22 +0000 (+0200) Subject: added error message for missing definitions in PLAY mode X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=b841b91bb2381c7553863d165ebfc5b6a323b9d2;p=l2e.git added error message for missing definitions in PLAY mode --- diff --git a/src/main.cpp b/src/main.cpp index 8f19f43..964fce0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -142,6 +142,13 @@ int main(int argc, char **argv) { Interpreter intp(source); intp.ReadSource(); + if (intp.PostponedDefinitions().size() > 0) { + for (vector::const_iterator i(intp.PostponedDefinitions().begin()), end(intp.PostponedDefinitions().end()); i != end; ++i) { + std::cerr << "missing definition of " << TypeDescription::Get(i->linkedType).TypeName() << " " << i->identifier << std::endl; + } + return 3; + } + int battleResId(TypeDescription::GetTypeId("BattleResources")); int heroId(TypeDescription::GetTypeId("Hero")); int itemId(TypeDescription::GetTypeId("Item")); @@ -247,7 +254,7 @@ int main(int argc, char **argv) { return 0; } catch (Parser::Error &e) { cerr << "parsing exception in file " << e.File() << " on line " << e.Line() << ": " << e.what() << endl; - return 1; + return 2; } catch (exception &e) { cerr << "exception in main(): " << e.what() << endl; return 1;