summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2013-12-26 19:36:17 +0100
committerkrzys-h <krzys_h@interia.pl>2013-12-26 19:36:17 +0100
commit46a7aa98b092592a1d886ef60c662ffcf826611a (patch)
treef86f98d0f1b439d3d33d77739127e4650b776e67 /src
parentcf856fe77db96398a82ba8e493f5627237bdf5b9 (diff)
downloadcolobot-46a7aa98b092592a1d886ef60c662ffcf826611a.tar.gz
colobot-46a7aa98b092592a1d886ef60c662ffcf826611a.tar.bz2
colobot-46a7aa98b092592a1d886ef60c662ffcf826611a.zip
Added error message when unable to load script from file specified in CreateObject
Diffstat (limited to 'src')
-rw-r--r--src/object/robotmain.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 47f06b3..8b79c89 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -4546,13 +4546,6 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (Cmd(line, "MissionController") && read[0] == 0 && m_version >= 2)
{
- /* TODO: ???
- if (!m_beginObject)
- {
- GetLogger()->Error("Syntax error in file '%s' (line %d): MissionController before BeginObject\n", filename, lineNum);
- continue;
- }*/
-
m_controller = CreateObject(Math::Vector(0.0f, 0.0f, 0.0f), 0.0f, 1.0f, 0.0f, OBJECT_CONTROLLER, 100.0f, false, false, 0);
m_controller->SetMagnifyDamage(100.0f);
CBrain* brain = m_controller->GetBrain();
@@ -6021,7 +6014,9 @@ void CRobotMain::CompileScript(bool soluce)
char* name = brain->GetScriptName(j);
if (name[0] != 0)
{
- brain->ReadProgram(j, name);
+ if(! brain->ReadProgram(j, name)) {
+ CLogger::GetInstancePointer()->Error("Unable to read script from file \"%s\"\n", name);
+ }
if (!brain->GetCompile(j)) nbError++;
}
}