]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/objectives.cpp
Incorrect reference to SDL_FRMEWORK
[quix0rs-blobwars.git] / src / objectives.cpp
index 7d78fbc17f9f8ee44722cc41df56aa3ab4659617..454d5db6791ee305e590419eaabfbd95d3fb1794 100644 (file)
@@ -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,26 @@ 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");
                                        }
 
                                        engine.setInfoMessage(message, 9, INFO_OBJECTIVE);
@@ -301,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;
                                                }