Add pip-boy automaps patch

This commit is contained in:
Alexander Batalov 2022-08-29 16:07:34 +03:00
parent e3a811c83d
commit c593eceaaf
3 changed files with 20 additions and 1 deletions

View File

@ -66,7 +66,7 @@ static const int _defam[AUTOMAP_MAP_COUNT][ELEVATION_COUNT] = {
};
// 0x41B560
static const int _displayMapList[AUTOMAP_MAP_COUNT] = {
static int _displayMapList[AUTOMAP_MAP_COUNT] = {
-1,
-1,
-1,
@ -1153,3 +1153,10 @@ int automapGetHeader(AutomapHeader** automapHeaderPtr)
return 0;
}
void automapSetDisplayMap(int map, bool available)
{
if (map >= 0 && map < AUTOMAP_MAP_COUNT) {
_displayMapList[map] = available ? 0 : -1;
}
}

View File

@ -54,4 +54,6 @@ int automapRenderInPipboyWindow(int win, int map, int elevation);
int automapSaveCurrent();
int automapGetHeader(AutomapHeader** automapHeaderPtr);
void automapSetDisplayMap(int map, bool available);
#endif /* AUTOMAP_H */

View File

@ -2,6 +2,7 @@
#include "animation.h"
#include "art.h"
#include "automap.h"
#include "color.h"
#include "combat.h"
#include "combat_ai.h"
@ -2963,6 +2964,15 @@ int _wmMapInit()
}
}
// SFALL: Pip-boy automaps patch.
if (configGetString(&config, section, "automap", &str)) {
if (strParseStrFromList(&str, &num, _wmYesNoStrs, 2) == -1) {
return -1;
}
automapSetDisplayMap(mapIndex, num);
}
if (configGetString(&config, section, "random_start_point_0", &str)) {
j = 0;
while (str != NULL) {