Skip to content

Commit 9f3cbde

Browse files
committed
swars: Reamde update_flic_mods()
1 parent b6e949e commit 9f3cbde

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
lines changed

src/febrief.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,12 @@ void purple_unkn2_data_to_screen(void)
244244

245245
void load_netscan_map(ushort mapno)
246246
{
247+
char locstr[DISKPATH_SIZE];
248+
PathInfo *pinfo;
247249
TbFileHandle fh;
248-
char locstr[52];
249250

250-
sprintf(locstr, "maps/map%03d.scn", mapno);
251+
pinfo = &game_dirs[DirPlace_Maps];
252+
snprintf(locstr, DISKPATH_SIZE-1, "%s/map%03d.scn", pinfo->directory, mapno);
251253
fh = LbFileOpen(locstr, Lb_FILE_MODE_READ_ONLY);
252254
if (fh != INVALID_FILE) {
253255
LbFileRead(fh, SCANNER_data, SCANNER_MAPDATA_WIDTH * SCANNER_MAPDATA_HEIGHT);

src/fecryo.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,44 @@ ubyte cryo_blokey_mod_level(ubyte ordpart)
953953

954954
void update_flic_mods(ubyte *mods)
955955
{
956+
#if 0
956957
asm volatile ("call ASM_update_flic_mods\n"
957958
: : "a" (mods));
959+
#endif
960+
short plagent, i;
961+
ubyte lv;
962+
963+
plagent = selected_agent;
964+
if (plagent < 4)
965+
{
966+
mods[0] = cybmod_chest_level(&cryo_agents.Mods[plagent]);
967+
mods[1] = cybmod_brain_level(&cryo_agents.Mods[plagent]);
968+
mods[2] = cybmod_arms_level(&cryo_agents.Mods[plagent]);
969+
mods[3] = cybmod_legs_level(&cryo_agents.Mods[plagent]);
970+
return;
971+
}
972+
973+
for (i = 0; i < 4; i++)
974+
mods[i] = 3;
975+
976+
for (plagent = 0; plagent < 4; plagent++)
977+
{
978+
lv = cybmod_chest_level(&cryo_agents.Mods[plagent]);
979+
if (lv < mods[0])
980+
mods[0] = lv;
981+
982+
lv = cybmod_brain_level(&cryo_agents.Mods[plagent]);
983+
if (lv < mods[1])
984+
mods[1] = lv;
985+
986+
lv = cybmod_arms_level(&cryo_agents.Mods[plagent]);
987+
if (lv < mods[2])
988+
mods[2] = lv;
989+
990+
lv = cybmod_legs_level(&cryo_agents.Mods[plagent]);
991+
if (lv < mods[3])
992+
mods[3] = lv;
993+
}
958994
}
959995

960996
/** Draws body mods, either images or anims, on pre-drawn background.

src/lvfiles.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,12 +1395,14 @@ void prepare_map_dat_to_play(void)
13951395

13961396
TbResult load_map_mad(ushort mapno)
13971397
{
1398-
char mad_fname[52];
1398+
char mad_fname[DISKPATH_SIZE];
1399+
PathInfo *pinfo;
13991400
long fsize;
14001401

14011402
next_local_mat = 1;
14021403

1403-
sprintf(mad_fname, "%s/map%03d.mad", "maps", mapno);
1404+
pinfo = &game_dirs[DirPlace_Maps];
1405+
snprintf(mad_fname, DISKPATH_SIZE-1, "%s/map%03d.mad", pinfo->directory, mapno);
14041406
fsize = LbFileLoadAt(mad_fname, scratch_malloc_mem);
14051407
if (fsize == Lb_FAIL)
14061408
return Lb_FAIL;
@@ -1414,11 +1416,11 @@ TbResult load_map_mad(ushort mapno)
14141416
return Lb_SUCCESS;
14151417
}
14161418

1417-
void load_map_bnb(int a1)
1419+
void load_map_bnb(ushort mapno)
14181420
{
14191421
#if 0
14201422
asm volatile ("call ASM_load_map_bnb\n"
1421-
: : "a" (a1));
1423+
: : "a" (mapno));
14221424
#endif
14231425
char locstr[DISKPATH_SIZE];
14241426
PathInfo *pinfo;
@@ -1427,7 +1429,7 @@ void load_map_bnb(int a1)
14271429
ubyte Bmin, Bmax;
14281430

14291431
pinfo = &game_dirs[DirPlace_Maps];
1430-
snprintf(locstr, DISKPATH_SIZE-1, "%s/map%03d.b&b", pinfo->directory, a1);
1432+
snprintf(locstr, DISKPATH_SIZE-1, "%s/map%03d.b&b", pinfo->directory, mapno);
14311433
fh = LbFileOpen(locstr, Lb_FILE_MODE_READ_ONLY);
14321434
if (fh == INVALID_FILE)
14331435
{

0 commit comments

Comments
 (0)