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.
This commit is contained in:
Guus Sliepen 2012-02-27 15:35:56 +01:00
parent 4c5eed148f
commit 336a0798fa
4 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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();
}

View File

@ -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