]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/CGame.cpp
Do not use DESTDIR in PREFIX, but only in the install target.
[quix0rs-blobwars.git] / src / CGame.cpp
index 7741b6d79374730e1850dad02ed2edd70fef85f2..2b3f7503b2011521d75ab4bdb619bd193d38f7b4 100644 (file)
@@ -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
@@ -66,8 +66,8 @@ void Game::clear()
                bulletsHit[i] = bulletsFired[i] = 0;
        }
 
-       strcpy(mapName, "data/grasslands1");
-       strcpy(stageName, "Grasslands");
+       strlcpy(mapName, "data/grasslands1", sizeof mapName);
+       strlcpy(stageName, "Grasslands", sizeof stageName);
 
        continuesUsed = 0;
        levelsStarted = 0;
@@ -117,7 +117,7 @@ void Game::setCheckPoint(float x, float y)
        checkPointY = (int)y;
 }
 
-void Game::getCheckPoint(float *x, float *y)
+void Game::getCheckPoint(float *x, float *y) const
 {
        *x = checkPointX;
        *y = checkPointY;
@@ -159,7 +159,7 @@ int Game::getWeaponAccuracy(int weapon)
        return 0;
 }
 
-int Game::getTotalBulletsFired()
+int Game::getTotalBulletsFired() const
 {
        return bulletsFired[0] + bulletsFired[1] + bulletsFired[2] + bulletsFired[3] + bulletsFired[4];
 }
@@ -221,12 +221,12 @@ void Game::totalUpStats()
 
 void Game::setStageName(const char *name)
 {
-       strcpy(stageName, name);
+       strlcpy(stageName, name, sizeof stageName);
 }
 
 void Game::setMapName(const char *name)
 {
-       strcpy(mapName, name);
+       strlcpy(mapName, name, sizeof mapName);
 }
 
 void Game::setMissionOver(int reason)