diff --git a/src/map.cc b/src/map.cc index 8b07d6f..333935f 100644 --- a/src/map.cc +++ b/src/map.cc @@ -108,7 +108,7 @@ int* gMapLocalVars = NULL; // map_vars // 0x51956C -static int* gMapGlobalVars = NULL; +int* gMapGlobalVars = NULL; // local_vars_num // 0x519570 @@ -116,7 +116,7 @@ int gMapLocalVarsLength = 0; // map_vars_num // 0x519574 -static int gMapGlobalVarsLength = 0; +int gMapGlobalVarsLength = 0; // Current elevation. // diff --git a/src/map.h b/src/map.h index 09247f8..70e8d7f 100644 --- a/src/map.h +++ b/src/map.h @@ -69,7 +69,9 @@ typedef void IsoWindowRefreshProc(Rect* rect); extern int gMapSid; extern int* gMapLocalVars; +extern int* gMapGlobalVars; extern int gMapLocalVarsLength; +extern int gMapGlobalVarsLength; extern int gElevation; extern MessageList gMapMessageList; diff --git a/src/mapper/mp_targt.cc b/src/mapper/mp_targt.cc index 4a8f517..e5249d2 100644 --- a/src/mapper/mp_targt.cc +++ b/src/mapper/mp_targt.cc @@ -4,6 +4,7 @@ #include "art.h" #include "game.h" +#include "map.h" #include "proto.h" #include "window_manager_private.h" @@ -100,4 +101,29 @@ int target_pick_global_var(int* value_ptr) return 0; } +// 0x49BE20 +int target_pick_map_var(int* value_ptr) +{ + int value; + int rc; + + if (gMapGlobalVarsLength == 0) { + return -1; + } + + rc = win_get_num_i(&value, + 0, + gMapGlobalVarsLength - 1, + false, + "Map Variable Index #:", + 100, + 100); + if (rc == -1) { + return -1; + } + + *value_ptr = value; + return 0; +} + } // namespace fallout diff --git a/src/mapper/mp_targt.h b/src/mapper/mp_targt.h index b553db3..d22c700 100644 --- a/src/mapper/mp_targt.h +++ b/src/mapper/mp_targt.h @@ -10,6 +10,7 @@ int target_init(); int target_exit(); int pick_rot(); int target_pick_global_var(int* value_ptr); +int target_pick_map_var(int* value_ptr); } // namespace fallout