This commit is contained in:
momo5502 2016-11-01 21:09:50 +01:00
parent a326f2b64d
commit aad579048c
2 changed files with 25 additions and 0 deletions

View File

@ -251,6 +251,26 @@ namespace Components
}
}
void UIFeeder::ApplyMapFeeder(Game::dvar_t* dvar, int num)
{
Dvar::Var(dvar).Set(num);
if (num < 0 || num >= *Game::arenaCount)
{
num = 0;
}
// UI_SortArenas
Utils::Hook::Call<void()>(0x630AE0)();
const char* mapname = ArenaLength::NewArenas[reinterpret_cast<int*>(0x633E934)[num]].mapName;
Dvar::Var("ui_mapname").Set(mapname);
// Party_SetDisplayMapName
Utils::Hook::Call<void(const char*)>(0x503B50)(mapname);
}
UIFeeder::UIFeeder()
{
// Get feeder item count
@ -276,6 +296,9 @@ namespace Components
// some thing overwriting feeder 2's data
Utils::Hook::Set<BYTE>(0x4A06A9, 0xEB);
// correct feeder 4
Utils::Hook(0x4C260E, UIFeeder::ApplyMapFeeder, HOOK_CALL).Install()->Quick();
}
UIFeeder::~UIFeeder()

View File

@ -50,5 +50,7 @@ namespace Components
static void PlaySoundStub();
static std::map<float, Callbacks> Feeders;
static void ApplyMapFeeder(Game::dvar_t* dvar, int num);
};
}