Add target_make_path

This commit is contained in:
Alexander Batalov 2023-07-24 08:08:01 +03:00
parent 708862ca24
commit ac1f4477ef
2 changed files with 27 additions and 0 deletions

View File

@ -1,7 +1,18 @@
#include "mapper/mp_targt.h" #include "mapper/mp_targt.h"
#include <string.h>
#include "art.h"
#include "proto.h"
namespace fallout { namespace fallout {
// 0x53F354
static char default_target_path_base[] = "\\fallout2\\dev\\proto\\";
// 0x559CD0
static char* target_path_base = default_target_path_base;
// 0x559DBC // 0x559DBC
static bool tgt_overriden = false; static bool tgt_overriden = false;
@ -17,6 +28,21 @@ bool target_overriden()
return tgt_overriden; return tgt_overriden;
} }
// 0x49B34C
void target_make_path(char* path, int pid)
{
if (_cd_path_base[0] != '\0' && _cd_path_base[1] == ':') {
strncpy(path, _cd_path_base, 2);
strcat(path, target_path_base);
} else {
strcpy(path, target_path_base);
}
if (pid != -1) {
strcat(path, artGetObjectTypeName(PID_TYPE(pid)));
}
}
// 0x49B424 // 0x49B424
int target_init() int target_init()
{ {

View File

@ -5,6 +5,7 @@ namespace fallout {
void target_override_protection(); void target_override_protection();
bool target_overriden(); bool target_overriden();
void target_make_path(char* path, int pid);
int target_init(); int target_init();
int target_exit(); int target_exit();