diff --git a/src/actions.cc b/src/actions.cc index 292e5ce..8368546 100644 --- a/src/actions.cc +++ b/src/actions.cc @@ -48,6 +48,9 @@ typedef enum ScienceRepairTargetType { // 0x5106D0 static bool _action_in_explode = false; +// 0x5106D4 +int rotation; + // 0x5106E0 static const int gNormalDeathAnimations[DAMAGE_TYPE_COUNT] = { ANIM_DANCING_AUTOFIRE, diff --git a/src/actions.h b/src/actions.h index 67d425f..86c0f31 100644 --- a/src/actions.h +++ b/src/actions.h @@ -6,6 +6,8 @@ namespace fallout { +extern int rotation; + int _action_attack(Attack* attack); int _action_use_an_item_on_object(Object* a1, Object* a2, Object* a3); int _action_use_an_object(Object* a1, Object* a2); diff --git a/src/mapper/map_func.cc b/src/mapper/map_func.cc index 92a96fa..1fcd136 100644 --- a/src/mapper/map_func.cc +++ b/src/mapper/map_func.cc @@ -1,13 +1,17 @@ #include "mapper/map_func.h" +#include "actions.h" #include "color.h" #include "game_mouse.h" #include "input.h" +#include "map.h" #include "memory.h" #include "mouse.h" #include "proto.h" #include "svga.h" +#include "tile.h" #include "window_manager.h" +#include "window_manager_private.h" namespace fallout { @@ -26,6 +30,32 @@ void copy_proto_lists() // TODO: Incomplete. } +// 0x482708 +void place_entrance_hex() +{ + int x; + int y; + int tile; + + while (inputGetInput() != -2) { + } + + if ((mouseGetEvent() & MOUSE_EVENT_LEFT_BUTTON_DOWN) != 0) { + if (_mouse_click_in(0, 0, _scr_size.right - _scr_size.left, _scr_size.bottom - _scr_size.top - 100)) { + mouseGetPosition(&x, &y); + + tile = tileFromScreenXY(x, y, gElevation); + if (tile != -1) { + if (tileSetCenter(tile, TILE_SET_CENTER_FLAG_IGNORE_SCROLL_RESTRICTIONS) == 0) { + mapSetEnteringLocation(tile, gElevation, rotation); + } else { + win_timed_msg("ERROR: Entrance out of range!", _colorTable[31744]); + } + } + } + } +} + // 0x4841C4 void pick_region(Rect* rect) { diff --git a/src/mapper/map_func.h b/src/mapper/map_func.h index 71517e9..ff06627 100644 --- a/src/mapper/map_func.h +++ b/src/mapper/map_func.h @@ -7,6 +7,7 @@ namespace fallout { void setup_map_dirs(); void copy_proto_lists(); +void place_entrance_hex(); void pick_region(Rect* rect); void sort_rect(Rect* a, Rect* b); void draw_rect(Rect* rect, unsigned char color);