From f14f37f970a8ceb686a6a5e0bd7b165b3395b717 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 2 Sep 2023 14:39:31 +0300 Subject: [PATCH] Add target_override_protection --- src/mapper/mp_proto.cc | 6 ++++++ src/mapper/mp_proto.h | 1 + src/mapper/mp_targt.cc | 13 ++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/mapper/mp_proto.cc b/src/mapper/mp_proto.cc index 513fb57..2b0ef90 100644 --- a/src/mapper/mp_proto.cc +++ b/src/mapper/mp_proto.cc @@ -29,6 +29,12 @@ static int mp_pick_kill_type(); static char kYes[] = "YES"; static char kNo[] = "NO"; +// 0x53DAFC +static char default_proto_builder_name[36] = "EVERTS SCOTTY"; + +// 0x559924 +char* proto_builder_name = default_proto_builder_name; + // 0x559B94 static const char* wall_light_strs[] = { "North/South", diff --git a/src/mapper/mp_proto.h b/src/mapper/mp_proto.h index e6a520e..e4e1443 100644 --- a/src/mapper/mp_proto.h +++ b/src/mapper/mp_proto.h @@ -3,6 +3,7 @@ namespace fallout { +extern char* proto_builder_name; extern bool can_modify_protos; void init_mapper_protos(); diff --git a/src/mapper/mp_targt.cc b/src/mapper/mp_targt.cc index b654011..1ea92df 100644 --- a/src/mapper/mp_targt.cc +++ b/src/mapper/mp_targt.cc @@ -5,6 +5,7 @@ #include "art.h" #include "game.h" #include "map.h" +#include "mapper/mp_proto.h" #include "proto.h" #include "window_manager_private.h" @@ -22,7 +23,17 @@ static bool tgt_overriden = false; // 0x49B2F0 void target_override_protection() { - // TODO: Incomplete. + char* name; + + tgt_overriden = true; + + name = getenv("MAIL_NAME"); + if (name != NULL) { + // NOTE: Unsafe, backing buffer is 32 byte max. + strcpy(proto_builder_name, strupr(name)); + } else { + strcpy(proto_builder_name, "UNKNOWN"); + } } // 0x49B2F0