X-Git-Url: https://git.jsancho.org/?p=lugaru.git;a=blobdiff_plain;f=Source%2FLevel%2FDialog.cpp;h=79740e0ceb5c3ff4cc568c4ff4bb54a478142b25;hp=ce15da6d2a508b9b92b8e249c79f8dbf6df9b117;hb=b9a46d8e2b7e7e22c706e7dd3734f31015db4408;hpb=8b6e8f3ad7390309795eb35c0959264cb7924402 diff --git a/Source/Level/Dialog.cpp b/Source/Level/Dialog.cpp index ce15da6..79740e0 100644 --- a/Source/Level/Dialog.cpp +++ b/Source/Level/Dialog.cpp @@ -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); }