From 6ce6639f10edaf11b7bfc65626701f4467f6d2e2 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Mon, 24 Jul 2023 10:57:31 +0300 Subject: [PATCH] Add proto_wall_light_str --- src/mapper/mp_proto.cc | 36 ++++++++++++++++++++++++++++++++++++ src/mapper/mp_proto.h | 1 + 2 files changed, 37 insertions(+) diff --git a/src/mapper/mp_proto.cc b/src/mapper/mp_proto.cc index fc03401..8adc13f 100644 --- a/src/mapper/mp_proto.cc +++ b/src/mapper/mp_proto.cc @@ -18,6 +18,16 @@ static void proto_critter_flags_redraw(int win, int pid); static int proto_critter_flags_modify(int pid); static int mp_pick_kill_type(); +// 0x559B94 +static const char* wall_light_strs[] = { + "North/South", + "East/West", + "North Corner", + "South Corner", + "East Corner", + "West Corner", +}; + // 0x559C60 bool can_modify_protos = false; @@ -55,6 +65,32 @@ void init_mapper_protos() // TODO: Incomplete. } +// 0x495438 +const char* proto_wall_light_str(int flags) +{ + if ((flags & 0x8000000) != 0) { + return wall_light_strs[1]; + } + + if ((flags & 0x10000000) != 0) { + return wall_light_strs[2]; + } + + if ((flags & 0x20000000) != 0) { + return wall_light_strs[3]; + } + + if ((flags & 0x40000000) != 0) { + return wall_light_strs[4]; + } + + if ((flags & 0x80000000) != 0) { + return wall_light_strs[5]; + } + + return wall_light_strs[0]; +} + // 0x4960B8 void proto_critter_flags_redraw(int win, int pid) { diff --git a/src/mapper/mp_proto.h b/src/mapper/mp_proto.h index 58a7277..e6a520e 100644 --- a/src/mapper/mp_proto.h +++ b/src/mapper/mp_proto.h @@ -6,6 +6,7 @@ namespace fallout { extern bool can_modify_protos; void init_mapper_protos(); +const char* proto_wall_light_str(int flags); int proto_pick_ai_packet(int* value); } // namespace fallout