X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FLevel%2FDialog.cpp;h=7649c2a308ec35575ef60ee1ead1e40722d80ce8;hb=0aab437dc560d2afa982e61cc2547756ad7b0761;hp=ce15da6d2a508b9b92b8e249c79f8dbf6df9b117;hpb=8b6e8f3ad7390309795eb35c0959264cb7924402;p=lugaru.git diff --git a/Source/Level/Dialog.cpp b/Source/Level/Dialog.cpp index ce15da6..7649c2a 100644 --- a/Source/Level/Dialog.cpp +++ b/Source/Level/Dialog.cpp @@ -1,6 +1,6 @@ /* Copyright (C) 2003, 2010 - Wolfire Games -Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file) +Copyright (C) 2010-2017 - Lugaru contributors (see AUTHORS file) This file is part of Lugaru. @@ -69,8 +69,9 @@ std::string funpackf_string(FILE* tfile, int maxlength) char* text = new char[maxlength]; for (m = 0; m < templength; m++) { funpackf(tfile, "Bb", &text[m]); - if (text[m] == '\0') + if (text[m] == '\0') { break; + } } text[m] = 0; std::string result(text); @@ -104,8 +105,9 @@ DialogScene::DialogScene(FILE* tfile) funpackf(tfile, "Bi", &participantfocus); funpackf(tfile, "Bi", &participantaction); - for (int m = 0; m < 10; m++) + for (int m = 0; m < 10; m++) { funpackf(tfile, "Bf Bf Bf", &participantfacing[m].x, &participantfacing[m].y, &participantfacing[m].z); + } funpackf(tfile, "Bf Bf", &camerayaw, &camerapitch); } @@ -143,8 +145,9 @@ DialogScene::DialogScene(ifstream& ipstream) ipstream.ignore(256, ' '); getline(ipstream, text); for (int j = 0; j < 128; j++) { - if (text[j] == '\\') + if (text[j] == '\\') { text[j] = '\n'; + } } ipstream.ignore(256, ':'); ipstream >> sound; @@ -228,8 +231,9 @@ void DialogScene::save(FILE* tfile) fpackf(tfile, "Bi", participantfocus); fpackf(tfile, "Bi", participantaction); - for (int m = 0; m < 10; m++) + for (int m = 0; m < 10; m++) { fpackf(tfile, "Bf Bf Bf", participantfacing[m].x, participantfacing[m].y, participantfacing[m].z); + } fpackf(tfile, "Bf Bf", camerayaw, camerapitch); }