Rename state structs
Fixes UB leading to crash when exiting the game
This commit is contained in:
parent
a70912d311
commit
5e9cf96106
|
@ -6,18 +6,18 @@
|
|||
|
||||
namespace fallout {
|
||||
|
||||
struct State {
|
||||
struct SfallGlobalVarsState {
|
||||
std::unordered_map<uint64_t, int> vars;
|
||||
};
|
||||
|
||||
static bool sfallGlobalVarsStore(uint64_t key, int value);
|
||||
static bool sfallGlobalVarsFetch(uint64_t key, int& value);
|
||||
|
||||
static State* _state;
|
||||
static SfallGlobalVarsState* _state;
|
||||
|
||||
bool sfallGlobalVarsInit()
|
||||
{
|
||||
_state = new (std::nothrow) State();
|
||||
_state = new (std::nothrow) SfallGlobalVarsState();
|
||||
if (_state == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -30,16 +30,16 @@ struct List {
|
|||
size_t pos = 0;
|
||||
};
|
||||
|
||||
struct State {
|
||||
struct SfallListsState {
|
||||
std::unordered_map<int, List> lists;
|
||||
int nextListId = kInitialListId;
|
||||
};
|
||||
|
||||
static State* _state = nullptr;
|
||||
static SfallListsState* _state = nullptr;
|
||||
|
||||
bool sfallListsInit()
|
||||
{
|
||||
_state = new (std::nothrow) State();
|
||||
_state = new (std::nothrow) SfallListsState();
|
||||
if (_state == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue