Description: Don't overwrite static data files
 The code always tries to overwrite some data files when not using a .pak
 file. This is only useful for upstream development. Put #ifdefs around this
 code.
Author: Guus Sliepen <guus@debian.org>

--- starfighter-1.2.orig/code/aliens.cpp
+++ starfighter-1.2/code/aliens.cpp
@@ -1314,6 +1314,7 @@ void defineAliens(){loadAliens();}
 
 #else
 
+#if SAVEDATA
 static void saveAliens()
 {
 	FILE *fp;
@@ -1350,6 +1351,7 @@ static void saveAliens()
 
 	fclose(fp);
 }
+#endif
 
 /*
 Will be dumped into a data file at the end of the project
@@ -2033,7 +2035,9 @@ void defineAliens()
 	defEnemy[CD_URANUSBOSSWING2].collectValue = 250;
 	defEnemy[CD_URANUSBOSSWING2].flags = FL_WEAPCO | FL_IMMORTAL;
 
+#if SAVEDATA
 	saveAliens();
+#endif
 }
 
 #endif
--- starfighter-1.2.orig/code/shop.cpp
+++ starfighter-1.2/code/shop.cpp
@@ -310,6 +310,7 @@ void initShop(){loadShop();}
 
 #else
 
+#if SAVEDATA
 static void saveShop()
 {
 	FILE *fp;
@@ -336,6 +337,7 @@ static void saveShop()
 
 	fclose(fp);
 }
+#endif
 
 /*
 Throw into a data file in final build
@@ -471,7 +473,9 @@ void initShop()
 	player.x = 380;
 	player.y = 95;
 
+#if SAVEDATA
 	saveShop();
+#endif
 
 	drawShop();
 }
--- starfighter-1.2.orig/code/missions.cpp
+++ starfighter-1.2/code/missions.cpp
@@ -979,6 +979,7 @@ void initMissions(){loadMissions();}
 
 #else
 
+#if SAVEDATA
 static void saveMissions()
 {
 	FILE *fp;
@@ -1025,6 +1026,7 @@ static void saveMissions()
 		fclose(fp);
 	}
 }
+#endif
 
 /*
 This is where all the missions are defined. This will be placed
@@ -1438,6 +1440,8 @@ void initMissions()
 	missions[MAX_MISSIONS - 1].primaryType[0] = M_DESTROY_ALL_TARGETS;
 	missions[MAX_MISSIONS - 1].completed1[0] = OB_INCOMPLETE;
 
+#if SAVEDATA
 	saveMissions();
+#endif
 }
 #endif
--- starfighter-1.2.orig/code/weapons.cpp
+++ starfighter-1.2/code/weapons.cpp
@@ -71,6 +71,7 @@ void initWeapons() {loadWeapons();}
 
 #else
 
+#if SAVEDATA
 static void saveWeapons()
 {
 	FILE *fp;
@@ -99,6 +100,7 @@ static void saveWeapons()
 
 	fclose(fp);
 }
+#endif
 
 /*
 A list of predefined weaponary. Will most probably
@@ -254,7 +256,9 @@ void initWeapons()
 	weapon[W_DIRSHOCKMISSILE].imageIndex[0] = 4;
 	weapon[W_DIRSHOCKMISSILE].imageIndex[1] = 4;
 
+#if SAVEDATA
 	saveWeapons();
+#endif
 }
 
 #endif
