Some cleanup, bumped version number.

This commit is contained in:
onpon4 2015-02-27 14:53:23 -05:00
parent e6f8b3a65f
commit e6c59d2a24
6 changed files with 15 additions and 11 deletions

View File

@ -3,7 +3,7 @@ CXXFLAGS += `pkg-config --cflags sdl2 SDL2_image SDL2_mixer` -DLINUX
LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer` LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer`
OBJS = ai.o aliens.o audio.o bullets.o cargo.o collectable.o comms.o debris.o events.o explosions.o game.o globals.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o shop.o Starfighter.o title.o weapons.o OBJS = ai.o aliens.o audio.o bullets.o cargo.o collectable.o comms.o debris.o events.o explosions.o game.o globals.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o shop.o Starfighter.o title.o weapons.o
VERSION = 1.2-SDL2 VERSION = 1.3
PROG = starfighter PROG = starfighter
DOCS = docs/* DOCS = docs/*
DATA = data gfx sound DATA = data gfx sound

View File

@ -21,7 +21,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
chdir(DATADIR); if (chdir(DATADIR) == -1)
printf("Warning: failed to change directory to \"%s\"\n", DATADIR);
defineGlobals(); // Must do this first! defineGlobals(); // Must do this first!

View File

@ -58,7 +58,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "script.h" #include "script.h"
#include "shop.h" #include "shop.h"
#include "title.h" #include "title.h"
#include "version.h"
#include "weapons.h" #include "weapons.h"
#endif #endif

View File

@ -289,9 +289,6 @@ enum {
#define SHIP_HIT_INDEX 60 #define SHIP_HIT_INDEX 60
#ifndef PACKLOCATION
#define PACKLOCATION "starfighter.pak"
#endif
#ifndef PATH_MAX #ifndef PATH_MAX
#define PATH_MAX 4096 #define PATH_MAX 4096
#endif #endif

View File

@ -202,7 +202,11 @@ static void setSystemPlanets()
for (int i = 0 ; i < 10 ; i++) for (int i = 0 ; i < 10 ; i++)
{ {
fscanf(fp, "%d %s %d", &distance, name, &image); if (fscanf(fp, "%d %s %d", &distance, name, &image) < 3)
{
printf("Warning: Data file \"%s\" is not correctly formatted\n", string);
break;
}
systemPlanet[i].y = distance; systemPlanet[i].y = distance;
strcpy(systemPlanet[i].name, name); strcpy(systemPlanet[i].name, name);
@ -217,9 +221,13 @@ static void setSystemPlanets()
for (int i = 0 ; i < 10 ; i++) for (int i = 0 ; i < 10 ; i++)
{ {
fscanf(fp, "%d %d %s%*c", &messageMission, &messageSlot, face); if ((fscanf(fp, "%d %d %s%*c", &messageMission, &messageSlot, face) < 3) ||
fscanf(fp, "%[^\n]%*c", from); (fscanf(fp, "%[^\n]%*c", from) < 1) ||
fscanf(fp, "%[^\n]%*c", subject); (fscanf(fp, "%[^\n]%*c", subject) < 1))
{
printf("Warning: Data file \"%s\" is not correctly formatted\n", string);
break;
}
systemPlanet[i].messageMission = messageMission; systemPlanet[i].messageMission = messageMission;
systemPlanet[i].messageSlot = messageSlot; systemPlanet[i].messageSlot = messageSlot;

View File

@ -1 +0,0 @@