X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FLevel%2FDialog.cpp;h=ce15da6d2a508b9b92b8e249c79f8dbf6df9b117;hp=64d30155bce7eb10e5f93452f6720196a86543e6;hb=8b6e8f3ad7390309795eb35c0959264cb7924402;hpb=531fd8d27258d6c15d6fd221272c74b48602a85a diff --git a/Source/Level/Dialog.cpp b/Source/Level/Dialog.cpp index 64d3015..ce15da6 100644 --- a/Source/Level/Dialog.cpp +++ b/Source/Level/Dialog.cpp @@ -22,9 +22,9 @@ along with Lugaru. If not, see . #include "Game.hpp" #include "Objects/Person.hpp" -#include "Utils/binio.h" #include "Utils/Folders.hpp" #include "Utils/Input.hpp" +#include "Utils/binio.h" extern int hostile; @@ -43,7 +43,8 @@ void Dialog::loadDialogs(FILE* tfile) } } -Dialog::Dialog(FILE* tfile) : gonethrough(0) +Dialog::Dialog(FILE* tfile) + : gonethrough(0) { int numdialogscenes; funpackf(tfile, "Bi", &numdialogscenes); @@ -110,7 +111,8 @@ DialogScene::DialogScene(FILE* tfile) } /* Load dialog from txt file, used by console */ -Dialog::Dialog(int type, std::string filename) : type(type) +Dialog::Dialog(int type, std::string filename) + : type(type) { ifstream ipstream(Folders::getResourcePath(filename)); ipstream.ignore(256, ':'); @@ -125,7 +127,7 @@ Dialog::Dialog(int type, std::string filename) : type(type) ipstream.close(); } -DialogScene::DialogScene(ifstream &ipstream) +DialogScene::DialogScene(ifstream& ipstream) { ipstream.ignore(256, ':'); ipstream.ignore(256, ':'); @@ -154,13 +156,13 @@ void Dialog::tick(int id) bool special = (type > 9); if ((!hostile || (type > 40) && (type < 50)) && - (playerId < Person::players.size()) && - (playerId > 0) && - ((gonethrough == 0) || !special) && - (special || Input::isKeyPressed(Game::attackkey))) { + (playerId < Person::players.size()) && + (playerId > 0) && + ((gonethrough == 0) || !special) && + (special || Input::isKeyPressed(Game::attackkey))) { if ((distsq(&Person::players[0]->coords, &Person::players[playerId]->coords) < 6) || - (Person::players[playerId]->howactive >= typedead1) || - (type > 40) && (type < 50)) { + (Person::players[playerId]->howactive >= typedead1) || + (type > 40) && (type < 50)) { whichdialogue = id; play(); dialoguetime = 0;