]> git.localhorst.tv Git - l2e.git/commitdiff
added error message for missing definitions in PLAY mode
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sat, 15 Sep 2012 20:12:22 +0000 (22:12 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sat, 15 Sep 2012 20:12:22 +0000 (22:12 +0200)
src/main.cpp

index 8f19f435bfa25c3335222094c0ff01342d5066d4..964fce03e24671219a259fa460178808522ab516 100644 (file)
@@ -142,6 +142,13 @@ int main(int argc, char **argv) {
                Interpreter intp(source);
                intp.ReadSource();
 
+               if (intp.PostponedDefinitions().size() > 0) {
+                       for (vector<Interpreter::PostponedDefinition>::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;