From 383a7b716aff2af7f5f85278e6df49f908a8bdbf Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 15 Jun 2016 08:44:34 -0400 Subject: identation fix --- Changelog | 10 ++++++++++ brice.dat | 6 ++++-- main.cpp | 6 +++--- src/entities.cpp | 32 +++++++++++++++++++------------- xml/000.xml | 6 ++++-- xml/playerSpawnHill1.xml | 2 +- xml/playerSpawnHill1_Building1.xml | 6 +++--- 7 files changed, 44 insertions(+), 24 deletions(-) diff --git a/Changelog b/Changelog index 0f6c748..d0c136a 100644 --- a/Changelog +++ b/Changelog @@ -1052,3 +1052,13 @@ - worked on better inventory / general ui ~ more than 10800 lines of code (just counting .hpp's and .cpp's) + +6/15/2016: +========== + + - fixed major indentation problem with tinyxml + - windows build actually works first try..??? + - everybody's pushed and merged and stuff + - item rendering stuff + "I'm also trying to make it so that other entities can use items.. if that makes sense." + - Andy diff --git a/brice.dat b/brice.dat index 3b090ad..8c8c697 100644 --- a/brice.dat +++ b/brice.dat @@ -1,7 +1,9 @@ -3 +4 + + canSprint 0 canJump 0 Slow -1 +0 diff --git a/main.cpp b/main.cpp index 52841c6..f4f8e9c 100644 --- a/main.cpp +++ b/main.cpp @@ -264,8 +264,8 @@ int main(int argc, char *argv[]) for (const auto &xf : xmlFiles) { if (xf[0] != '.') { XMLDocument xmld; - auto file = xmlFolder + xf; - xmld.LoadFile(file.c_str()); + auto file = (xmlFolder + xf).c_str(); + xmld.LoadFile(file); auto xmle = xmld.FirstChildElement("World"); @@ -285,7 +285,7 @@ int main(int argc, char *argv[]) xmle->DeleteAttribute("dindex"); xmle = xmle->NextSiblingElement(); } - xmld.SaveFile(file.c_str(), false); + xmld.SaveFile(file, false); } } diff --git a/src/entities.cpp b/src/entities.cpp index 90e03eb..a711fc9 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -631,7 +631,7 @@ extern int commonAIFunc(NPC *speaker); void NPC::interact() { //have the npc's interact back to the player std::thread([this]{ std::vector dopt; - XMLDocument xml; + XMLDocument *xml; XMLElement *exml,*oxml; static unsigned int oldidx = 9999; @@ -644,22 +644,27 @@ void NPC::interact() { //have the npc's interact back to the player loc.y += 5; - canMove=false; - left = (player->loc.x < loc.x); - right = !left; + // freeze the npc, face the player + canMove = false; + left = (player->loc.x < loc.x); + right = !left; + // if there's actual scripted stuff to do, do it if (dialogCount && dialogIndex != 9999) { // load the XML file and find the dialog tags - if (outnabout == 0) - xml.LoadFile(currentXML.c_str()); - else if (outnabout < 0) - xml.LoadFile((xmlFolder + currentWorld->getToLeft()).c_str()); - else - xml.LoadFile((xmlFolder + currentWorld->getToRight()).c_str()); + if (outnabout == 0) { + xml = ¤tXMLDoc; + } else if (outnabout < 0) { + xml = new XMLDocument(); + xml->LoadFile((xmlFolder + currentWorld->getToLeft()).c_str()); + } else { + xml = new XMLDocument(); + xml->LoadFile((xmlFolder + currentWorld->getToRight()).c_str()); + } COMMONAIFUNC: idx = 0; stop = false; - exml = xml.FirstChildElement("Dialog"); + exml = xml->FirstChildElement("Dialog"); // search for the dialog block associated with this npc while (exml->StrAttribute("name") != name) @@ -726,10 +731,11 @@ COMMONAIFUNC: } // asdlfkj - if (exml->GetText() == nullptr) + auto txml = exml->FirstChildElement("content"); + if (txml == nullptr) goto OTHERSTUFF; - ptr = exml->GetText() - 1; + ptr = txml->GetText() - 1; while (*++ptr && isspace(*ptr)); // handle dialog options diff --git a/xml/000.xml b/xml/000.xml index 1806332..de079ca 100644 --- a/xml/000.xml +++ b/xml/000.xml @@ -18,8 +18,10 @@ -600 - ... - 700 + 700 + + ... + diff --git a/xml/playerSpawnHill1.xml b/xml/playerSpawnHill1.xml index f997b4d..06a27c4 100644 --- a/xml/playerSpawnHill1.xml +++ b/xml/playerSpawnHill1.xml @@ -19,7 +19,7 @@ ... - 1000 + 1000 diff --git a/xml/playerSpawnHill1_Building1.xml b/xml/playerSpawnHill1_Building1.xml index d5c07b3..0977b8f 100644 --- a/xml/playerSpawnHill1_Building1.xml +++ b/xml/playerSpawnHill1_Building1.xml @@ -10,17 +10,17 @@ Hey. Have a Dank MayMay :) - + What? You want another Dank MayMay? K. - + Well... I'm out of Dank MayMays. Have a sword though. - + -- cgit v1.2.3