Add scripts_request_townmap

This commit is contained in:
Alexander Batalov 2023-07-22 17:09:19 +03:00
parent cbb9cbc6fd
commit 4b65bdf021
2 changed files with 14 additions and 3 deletions

View File

@ -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()

View File

@ -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);