From e68c2a4784c80e389f05a809c1bd83cd1fc9fe58 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sun, 23 Jul 2023 09:39:13 +0300 Subject: [PATCH] Add mapper_mark_exit_grid --- src/mapper/mapper.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/mapper/mapper.cc b/src/mapper/mapper.cc index a3885e9..da5072b 100644 --- a/src/mapper/mapper.cc +++ b/src/mapper/mapper.cc @@ -1,15 +1,45 @@ #include "mapper/mapper.h" +#include "game_mouse.h" #include "object.h" #include "proto.h" namespace fallout { +static int mapper_mark_exit_grid(); static void mapper_mark_all_exit_grids(); // 0x559748 MapTransition mapInfo = { -1, -1, 0, 0 }; +// 0x48C678 +int mapper_mark_exit_grid() +{ + int y; + int x; + int tile; + Object* obj; + + for (y = -2000; y != 2000; y += 200) { + for (x = -10; x < 10; x++) { + tile = gGameMouseBouncingCursor->tile + y + x; + + 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(); + } + } + } + + return 0; +} + // 0x48C704 void mapper_mark_all_exit_grids() {