From 963fa15a1c3b2b611163e07fc468c7da97ab5b98 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Sun, 19 Jul 2015 16:43:03 +0200 Subject: [PATCH] Fix for #516 --- src/object/robotmain.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 1866fbc8..90a1ca50 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -5110,6 +5110,8 @@ CObject* CRobotMain::IOReadScene(const char *filename, const char *filecbot) m_base = nullptr; + CObject* cargo = nullptr; + CObject* power = nullptr; CObject* sel = nullptr; int objRank = 0; for (auto& line : levelParser.GetLines()) @@ -5129,11 +5131,9 @@ CObject* CRobotMain::IOReadScene(const char *filename, const char *filecbot) m_lightning->SetStatus(sleep, delay, magnetic, progress); } - CObject* cargo = nullptr; if (line->GetCommand() == "CreateFret") cargo = IOReadObject(line.get(), filename, -1); - CObject* power = nullptr; if (line->GetCommand() == "CreatePower") power = IOReadObject(line.get(), filename, -1); @@ -5161,6 +5161,8 @@ CObject* CRobotMain::IOReadScene(const char *filename, const char *filecbot) assert(power->Implements(ObjectInterfaceType::Transportable)); dynamic_cast(power)->SetTransporter(obj); } + cargo = nullptr; + power = nullptr; } }