diff --git a/Levels/ObjectSetups/Level1.xml b/Levels/ObjectSetups/Level1.xml index 2d5fa20..24f41f4 100644 --- a/Levels/ObjectSetups/Level1.xml +++ b/Levels/ObjectSetups/Level1.xml @@ -21,8 +21,8 @@ false 0 deleteRandomObject - 1 - 5 + 0 + 0 0 @@ -65,9 +65,9 @@ false 0 - - - - - - - + 0 + 0 + 0 @@ -94,9 +94,9 @@ false 0 - - - - - - - + 0 + 0 + 0 @@ -123,9 +123,9 @@ false 0 - - - - - - - + 0 + 0 + 0 @@ -152,9 +152,9 @@ false 0 - - - - - - - + 0 + 0 + 0 diff --git a/converter/converter.cc b/converter/converter.cc index b296fcd..11c83bf 100644 --- a/converter/converter.cc +++ b/converter/converter.cc @@ -194,9 +194,9 @@ std::vector Converter::newComposition(int type, float posX, float posZ){ isBiggerThan->SetText("false"); objectNum->SetText("0"); luaScript->SetText("-"); - toChangeIdGreen->SetText("-"); - toChangeIdBlue->SetText("-"); - toChangeObjNum->SetText("-"); + toChangeIdGreen->SetText("0"); + toChangeIdBlue->SetText("0"); + toChangeObjNum->SetText("0"); trigger->InsertEndChild(name); trigger->InsertEndChild(xPosition); diff --git a/level.cc b/level.cc index 1a64eb0..824e6ca 100644 --- a/level.cc +++ b/level.cc @@ -365,7 +365,7 @@ void Level::load() { } std::string luaScript = charLuaScript; - int toChangeIdGreen, toChangeIdBlue, toChangeObjNum, objectToChange=0; + int toChangeIdGreen, toChangeIdBlue, toChangeObjNum, objectToChange=-1; errorCheck(xmlTrigger->FirstChildElement("toChangeIdGreen")->QueryIntText(&toChangeIdGreen)); errorCheck(xmlTrigger->FirstChildElement("toChangeIdBlue")->QueryIntText(&toChangeIdBlue)); errorCheck(xmlTrigger->FirstChildElement("toChangeObjNum")->QueryIntText(&toChangeObjNum)); @@ -375,13 +375,8 @@ void Level::load() { } } if (object != 0) { - if (objectToChange != 0) { - Trigger trigger = Trigger(position, distance, isBigger, object, luaScript, L, objectToChange); - triggers.push_back(trigger); - } - else { - printf("Object to be changed by a trigger not found.\n"); - } + Trigger trigger = Trigger(position, distance, isBigger, object, luaScript, L, objectToChange); + triggers.push_back(trigger); } else { printf("Triggering object not found.\n"); @@ -484,6 +479,11 @@ std::vector* Level::getObjects() { void Level::deleteObject(int objectIndex){ objects.erase(objects.begin() + objectIndex); + for(unsigned int i = 0; i