From 78ae0fb3bf1d2acfb7e90e7b3d0f57ebac41466a Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sun, 23 Jul 2023 09:25:56 +0300 Subject: [PATCH] Add mapper_mark_all_exit_grids --- src/mapper/mapper.cc | 30 ++++++++++++++++++++++++++++++ src/mapper/mapper.h | 12 ++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/mapper/mapper.cc create mode 100644 src/mapper/mapper.h diff --git a/src/mapper/mapper.cc b/src/mapper/mapper.cc new file mode 100644 index 0000000..a3885e9 --- /dev/null +++ b/src/mapper/mapper.cc @@ -0,0 +1,30 @@ +#include "mapper/mapper.h" + +#include "object.h" +#include "proto.h" + +namespace fallout { + +static void mapper_mark_all_exit_grids(); + +// 0x559748 +MapTransition mapInfo = { -1, -1, 0, 0 }; + +// 0x48C704 +void mapper_mark_all_exit_grids() +{ + Object* obj; + + obj = objectFindFirstAtElevation(gElevation); + while (obj != NULL) { + if (isExitGridPid(obj->pid)) { + obj->data.misc.map = mapInfo.map; + obj->data.misc.tile = mapInfo.tile; + obj->data.misc.elevation = mapInfo.elevation; + obj->data.misc.rotation = mapInfo.rotation; + } + obj = objectFindNextAtElevation(); + } +} + +} // namespace fallout diff --git a/src/mapper/mapper.h b/src/mapper/mapper.h new file mode 100644 index 0000000..3d6adb3 --- /dev/null +++ b/src/mapper/mapper.h @@ -0,0 +1,12 @@ +#ifndef FALLOUT_MAPPER_MAPPER_H_ +#define FALLOUT_MAPPER_MAPPER_H_ + +#include "map.h" + +namespace fallout { + +extern MapTransition mapInfo; + +} // namespace fallout + +#endif /* FALLOUT_MAPPER_MAPPER_H_ */