From 4b65bdf0217d22dd0f5309d7b72ca0fb2c2c3267 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 22 Jul 2023 17:09:19 +0300 Subject: [PATCH] Add scripts_request_townmap --- src/scripts.cc | 14 ++++++++++++-- src/scripts.h | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/scripts.cc b/src/scripts.cc index ddcf5c6..58dab5d 100644 --- a/src/scripts.cc +++ b/src/scripts.cc @@ -913,8 +913,8 @@ int scriptsHandleRequests() } } - if ((gScriptsRequests & SCRIPT_REQUEST_0x02) != 0) { - gScriptsRequests &= ~SCRIPT_REQUEST_0x02; + if ((gScriptsRequests & SCRIPT_REQUEST_TOWN_MAP) != 0) { + gScriptsRequests &= ~SCRIPT_REQUEST_TOWN_MAP; wmTownMap(); } @@ -1128,6 +1128,16 @@ void _scripts_request_combat_locked(STRUCT_664980* a1) gScriptsRequests |= (SCRIPT_REQUEST_0x0400 | SCRIPT_REQUEST_COMBAT); } +// 0x4A461C +void scripts_request_townmap() +{ + if (isInCombat()) { + _game_user_wants_to_quit = 1; + } + + gScriptsRequests |= SCRIPT_REQUEST_TOWN_MAP; +} + // request_world_map() // 0x4A4644 void scriptsRequestWorldMap() diff --git a/src/scripts.h b/src/scripts.h index e061fd0..5cc3220 100644 --- a/src/scripts.h +++ b/src/scripts.h @@ -25,7 +25,7 @@ namespace fallout { typedef enum ScriptRequests { SCRIPT_REQUEST_COMBAT = 0x01, - SCRIPT_REQUEST_0x02 = 0x02, + SCRIPT_REQUEST_TOWN_MAP = 0x02, SCRIPT_REQUEST_WORLD_MAP = 0x04, SCRIPT_REQUEST_ELEVATOR = 0x08, SCRIPT_REQUEST_EXPLOSION = 0x10, @@ -175,6 +175,7 @@ int scriptsHandleRequests(); int _scripts_check_state_in_combat(); int scriptsRequestCombat(STRUCT_664980* a1); void _scripts_request_combat_locked(STRUCT_664980* ptr); +void scripts_request_townmap(); void scriptsRequestWorldMap(); int scriptsRequestElevator(Object* a1, int a2); int scriptsRequestExplosion(int tile, int elevation, int minDamage, int maxDamage);