Skip to content

Commit 3d32dab

Browse files
authored
Campaign specific swipeXX.dat files (#2684)
1 parent d26d475 commit 3d32dab

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

src/bflib_filelst.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct TbLoadFiles;
3333
typedef char *ModifyDataLoadFnameFunc(struct TbLoadFiles *);
3434

3535
struct TbLoadFiles {
36-
char FName[28];
36+
char FName[DISKPATH_SIZE];
3737
unsigned char **Start;
3838
unsigned char **SEnd;
3939
unsigned long SLength;

src/thing_creature.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "bflib_planar.h"
3030
#include "bflib_vidraw.h"
3131
#include "bflib_sound.h"
32+
#include "bflib_fileio.h"
3233

3334
#include "engine_lenses.h"
3435
#include "engine_arrays.h"
@@ -374,10 +375,23 @@ TbBool load_swipe_graphic_for_creature(const struct Thing *thing)
374375
sprintf(t_lfile->FName, "data/swipe%02d-%d.tab", swpe_idx, 32);
375376
t_lfile++;
376377
#else
377-
sprintf(t_lfile->FName, "data/swipe%02d.dat", swpe_idx);
378-
t_lfile++;
379-
sprintf(t_lfile->FName, "data/swipe%02d.tab", swpe_idx);
380-
t_lfile++;
378+
379+
char* fname = prepare_file_fmtpath(FGrp_CmpgConfig, "swipe%02d.dat",swpe_idx);
380+
if (!LbFileExists(fname))
381+
{
382+
fname = prepare_file_fmtpath(FGrp_StdData, "swipe%02d.dat",swpe_idx);
383+
}
384+
sprintf(t_lfile->FName, "%s", fname);
385+
t_lfile++;
386+
387+
fname = prepare_file_fmtpath(FGrp_CmpgConfig, "swipe%02d.tab",swpe_idx);
388+
if (!LbFileExists(fname))
389+
{
390+
fname = prepare_file_fmtpath(FGrp_StdData, "swipe%02d.tab",swpe_idx);
391+
}
392+
sprintf(t_lfile->FName, "%s", fname);
393+
t_lfile++;
394+
381395
#endif
382396
}
383397
if ( LbDataLoadAll(swipe_load_file) )

0 commit comments

Comments
 (0)