X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FLevel%2FDialog.cpp;h=64d30155bce7eb10e5f93452f6720196a86543e6;hb=475fb97fd19a8bc2c58c603d0bc5dcf8cc63b40d;hp=915fba1973908d3ce6adbf3ccfdc3d7db1f797ba;hpb=b84825978803615f45a9f128232e62431042aec0;p=lugaru.git diff --git a/Source/Level/Dialog.cpp b/Source/Level/Dialog.cpp index 915fba1..64d3015 100644 --- a/Source/Level/Dialog.cpp +++ b/Source/Level/Dialog.cpp @@ -18,13 +18,13 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -#include "Game.h" +#include "Level/Dialog.hpp" -#include "Level/Dialog.h" -#include "Objects/Person.h" +#include "Game.hpp" +#include "Objects/Person.hpp" #include "Utils/binio.h" -#include "Utils/Folders.h" -#include "Utils/Input.h" +#include "Utils/Folders.hpp" +#include "Utils/Input.hpp" extern int hostile; @@ -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); } }