From 3d2b993c40e8ac45460d270350d5f02e5a8d18de Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 18 Jan 2016 21:31:23 +0100 Subject: [PATCH] Changed: Minor changes --- .../leveldesign/mission_compiler_lib/main.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp b/code/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp index e7ae73a39..1c596e837 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp +++ b/code/ryzom/tools/leveldesign/mission_compiler_lib/main.cpp @@ -51,35 +51,35 @@ int main(int argc, char *argv[]) printf("%s [-test]", argv[0]); return -1; } - + string sourceDocName; if (!test) sourceDocName = argv[2]; else sourceDocName = "test_compilateur.primitive"; - + // remove the path sourceDocName = CFile::getFilename(sourceDocName); // init ligo NLLIGO::CLigoConfig LigoConfig; CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig; - + nlinfo("Reading ligo configuration file..."); if (!LigoConfig.readPrimitiveClass (argv[1], false)) { nlwarning("Can't read '%s' !", argv[1]); return -1; } - + NLLIGO::Register(); nlinfo("Reading primitive file..."); - + CPrimitives primDoc; CPrimitiveContext::instance().CurrentPrimitive = &primDoc; loadXmlPrimitiveFile(primDoc, sourceDocName, LigoConfig); - + CMissionCompiler mc; if (test) @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) script = script.replace(NL.c_str(), "\n"); const char *tmp = ::getenv("TEMP"); - + FILE *fp = ::fopen((string(tmp)+"/compiled_mission.script").c_str(), "w"); ::fwrite(script.data(), script.size(), 1, fp); ::fclose(fp); @@ -119,7 +119,7 @@ int main(int argc, char *argv[]) } return 0; } - + nlinfo("Compiling missions..."); try { @@ -166,14 +166,14 @@ int main(int argc, char *argv[]) TPrimitiveSet scripts; CPrimitiveSet filter; filter.buildSet(primDoc->RootNode, TPrimitiveClassPredicate("mission"), scripts); - + // for each script, check if it was generated, and if so, check the name // of the source primitive file. for (uint i=0; i *script; if (scripts[i]->getPropertyByName("script", script) && !script->empty()) - { + { // Format should be : #compiled from if (script->front().find("compiled from")) { @@ -208,14 +208,14 @@ int main(int argc, char *argv[]) if (bots.empty()) { - nlwarning("Can't find bot '%s' in primitive '%s' !", + nlwarning("Can't find bot '%s' in primitive '%s' !", mission.getGiverName().c_str(), fileName.c_str()); throw EParseException(NULL, "Can't find giver in primitive"); } else if (bots.size() > 1) { - nlwarning("Found more than one bot named '%s' in primitive '%s' !", + nlwarning("Found more than one bot named '%s' in primitive '%s' !", mission.getGiverName().c_str(), fileName.c_str()); throw EParseException(NULL, "More than one bot with giver name in primitive");