X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FAwards.cpp;h=5b27563eb7cf1d75e437e60c5ee12b0d5ef0e026;hb=599983e84cffd250055557d78b4d8b4af84cb092;hp=95fd129c40e034c845d92cc424ca86895ea76b9a;hpb=adaf84d76926538d8235c721169a8d8346dff87b;p=lugaru.git diff --git a/Source/Awards.cpp b/Source/Awards.cpp index 95fd129..5b27563 100644 --- a/Source/Awards.cpp +++ b/Source/Awards.cpp @@ -1,22 +1,20 @@ /* -Copyright (C) 2010 - Lugaru authors +Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file) This file is part of Lugaru. -Lugaru is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. +Lugaru is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. -This program is distributed in the hope that it will be useful, +Lugaru is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +along with Lugaru. If not, see . */ #include "Awards.h" @@ -30,8 +28,20 @@ float startbonustotal; float bonustime; float bonusnum[100]; +const char *bonus_names[bonus_count] = { +#define DECLARE_BONUS(id, name, ...) name, +#include "Bonuses.def" +#undef DECLARE_BONUS +}; + +const char *award_names[award_count] = { +#define DECLARE_AWARD(id, name) name, +#include "Awards.def" +#undef DECLARE_AWARD +}; + static const int bonus_values[bonus_count] = { -#define DECLARE_BONUS(id, name, value, ...) value, +#define DECLARE_BONUS(id, name, value) value, #include "Bonuses.def" #undef DECLARE_BONUS }; @@ -67,13 +77,13 @@ int maxalarmed; int award_awards(int *awards) { - int numawards = 0, i; + int numawards = 0; if (damagetaken == 0 && Person::players[0]->bloodloss == 0) { awards[numawards] = awardflawless; numawards++; } bool alldead = true; - for (i = 1; i < Person::players.size(); i++) { + for (unsigned i = 1; i < Person::players.size(); i++) { if (Person::players[i]->dead != 2) alldead = 0; } @@ -82,7 +92,7 @@ int award_awards(int *awards) numawards++; } alldead = 1; - for (i = 1; i < Person::players.size(); i++) { + for (unsigned i = 1; i < Person::players.size(); i++) { if (Person::players[i]->dead != 1) alldead = 0; } @@ -118,12 +128,12 @@ int award_awards(int *awards) awards[numawards] = awardacrobat; numawards++; } - if (numthrowkill == Person::players.size() - 1) { + if (numthrowkill == (int(Person::players.size()) - 1)) { awards[numawards] = awardlongrange; numawards++; } alldead = 1; - for (i = 1; i < Person::players.size(); i++) { + for (unsigned i = 1; i < Person::players.size(); i++) { if (Person::players[i]->dead != 2) alldead = 0; }