]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/objectives.cpp
Incorrect reference to SDL_FRMEWORK
[quix0rs-blobwars.git] / src / objectives.cpp
old mode 100755 (executable)
new mode 100644 (file)
index edc5ad4..454d5db
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -241,7 +241,7 @@ void checkObjectives(const char *name, bool alwaysInform)
 {
        Objective *objective = (Objective*)map.objectiveList.getHead();
 
-       char message[100];
+       char message[256];
        
        int requiredValue;
 
@@ -269,24 +269,24 @@ void checkObjectives(const char *name, bool alwaysInform)
                                {
                                        if (!map.isBossMission)
                                        {
-                                               sprintf(message, _("%s - Objective Completed - Check Point Reached!"), _(objective->description));
+                                               snprintf(message, sizeof message, _("%s - Objective Completed - Check Point Reached!"), _(objective->description));
                                                game.setObjectiveCheckPoint();
                                        }
                                        else
                                        {
-                                               sprintf(message, _("%s - Objective Completed"), _(objective->description));
+                                               snprintf(message, sizeof message, _("%s - Objective Completed"), _(objective->description));
                                        }
 
                                        if (strcmp(objective->description, "Get the Aqua Lung") == 0)
                                        {
-                                               sprintf(message, "Got the Aqua Lung! You can now swim forever!");
+                                               snprintf(message, sizeof message, "Got the Aqua Lung! You can now swim forever!");
                                                game.hasAquaLung = true;
                                                presentPlayerMedal("Aqua_Lung");
                                        }
 
                                        if (strcmp(objective->description, "Get the Jetpack") == 0)
                                        {
-                                               sprintf(message, "Got the Jetpack! Press SPACE to Activate!");
+                                               snprintf(message, sizeof message, "Got the Jetpack! Press SPACE to Activate!");
                                                game.hasJetPack = true;
                                                presentPlayerMedal("Jetpack");
                                        }
@@ -303,13 +303,13 @@ void checkObjectives(const char *name, bool alwaysInform)
                                                switch (Math::prand() % 3)
                                                {
                                                        case 0:
-                                                               sprintf(message, _("%s - %d more to go..."), _(objective->description), requiredValue);
+                                                               snprintf(message, sizeof message, _("%s - %d more to go..."), _(objective->description), requiredValue);
                                                                break;
                                                        case 1:
-                                                               sprintf(message, _("%s - need %d more"), _(objective->description), requiredValue);
+                                                               snprintf(message, sizeof message, _("%s - need %d more"), _(objective->description), requiredValue);
                                                                break;
                                                        case 2:
-                                                               sprintf(message, _("%s - %d of %d"), _(objective->description), objective->currentValue, objective->targetValue);
+                                                               snprintf(message, sizeof message, _("%s - %d of %d"), _(objective->description), objective->currentValue, objective->targetValue);
                                                                break;
                                                }