X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FLevel%2FDialog.cpp;h=64d30155bce7eb10e5f93452f6720196a86543e6;hb=475fb97fd19a8bc2c58c603d0bc5dcf8cc63b40d;hp=a60b115cb62bef1996b61a03271600f9058e4367;hpb=ed3662c0852c4312a612b4fc35bd03aba8d13db7;p=lugaru.git diff --git a/Source/Level/Dialog.cpp b/Source/Level/Dialog.cpp index a60b115..64d3015 100644 --- a/Source/Level/Dialog.cpp +++ b/Source/Level/Dialog.cpp @@ -80,10 +80,11 @@ std::string funpackf_string(FILE* tfile, int maxlength) void fpackf_string(FILE* tfile, std::string text) { fpackf(tfile, "Bi", text.size()); - for (int m = 0; m < text.size(); m++) { - fpackf(tfile, "Bb", text[m]); - if (text[m] == '\0') + for (unsigned i = 0; i < text.size(); i++) { + fpackf(tfile, "Bb", text[i]); + if (text[i] == '\0') { break; + } } } @@ -170,9 +171,9 @@ void Dialog::tick(int id) void Dialog::play() { - for (int i = 0; i < scenes.size(); i++) { + for (unsigned i = 0; i < scenes.size(); i++) { int playerId = scenes[i].participantfocus; - Person::players[playerId]->coords = participantlocation[playerId]; + Person::players.at(playerId)->coords = participantlocation[playerId]; Person::players[playerId]->yaw = participantyaw[playerId]; Person::players[playerId]->targetyaw = participantyaw[playerId]; Person::players[playerId]->velocity = 0; @@ -192,8 +193,8 @@ void Dialog::saveDialogs(FILE* tfile) { fpackf(tfile, "Bi", dialogs.size()); - for (int k = 0; k < dialogs.size(); k++) { - dialogs[k].save(tfile); + for (unsigned i = 0; i < dialogs.size(); i++) { + dialogs[i].save(tfile); } } @@ -205,7 +206,7 @@ void Dialog::save(FILE* tfile) fpackf(tfile, "Bf Bf Bf", participantlocation[l].x, participantlocation[l].y, participantlocation[l].z); fpackf(tfile, "Bf", participantyaw[l]); } - for (int l = 0; l < scenes.size(); l++) { + for (unsigned l = 0; l < scenes.size(); l++) { scenes[l].save(tfile); } }