]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/enemies.cpp
Update copyrights.
[quix0rs-blobwars.git] / src / enemies.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 9179ebc..f19d08a
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2010 Parallel Realities
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -377,8 +377,6 @@ void enemyBulletCollisions(Entity *bullet)
 
                if ((bullet->owner == &player) || (bullet->owner == &engine.world) || (bullet->flags & ENT_BOSS))
                {
-                       sprintf(comboString, "Combo-%s", bullet->name);
-
                        if (Collision::collision(enemy, bullet))
                        {
                                if (bullet->id != WP_LASER)
@@ -458,6 +456,7 @@ void enemyBulletCollisions(Entity *bullet)
                                                                checkCombo();
                                                        }
                                                        
+                                                       snprintf(comboString, sizeof comboString, "Combo-%s", bullet->name);
                                                        checkObjectives(comboString, false);
                                                        checkObjectives("Enemy", false);
                                                        checkObjectives(enemy->name, false);
@@ -505,6 +504,7 @@ void enemyBulletCollisions(Entity *bullet)
                                        {
                                                if (player.currentWeapon != &weapon[WP_LASER])
                                                {
+                                                       snprintf(comboString, sizeof comboString, "Combo-%s", bullet->name);
                                                        checkCombo();
                                                        checkObjectives(comboString, false);
                                                }
@@ -514,7 +514,7 @@ void enemyBulletCollisions(Entity *bullet)
                                if (game.currentComboHits >= 3)
                                {
                                        char message[50];
-                                       sprintf(message, _("%d Hit Combo!"), game.currentComboHits);
+                                       snprintf(message, sizeof message, _("%d Hit Combo!"), game.currentComboHits);
                                        engine.setInfoMessage(message, 0, INFO_NORMAL);
                                }
 
@@ -848,7 +848,7 @@ void loadDefEnemies()
 {
        for (int i = 0 ; i < MAX_ENEMIES ; i++)
        {
-               strcpy(defEnemy[i].name, "");
+               defEnemy[i].name[0] = 0;
        }
 
        int enemy = 0;