Playlist and zone fixes

This commit is contained in:
momo5502 2016-11-02 19:19:09 +01:00
parent 11ace37f2e
commit 6cf28b4170
5 changed files with 21 additions and 0 deletions

View File

@ -121,6 +121,17 @@ namespace Components
Game::Dvar_SetStringByName(cvar, value); Game::Dvar_SetStringByName(cvar, value);
} }
int Playlist::GetMapIndex(const char* mapname)
{
auto i = Playlist::MapRelocation.find(mapname);
if (i != Playlist::MapRelocation.end())
{
mapname = i->second.data();
}
return Game::Live_GetMapIndex(mapname);
}
Playlist::Playlist() Playlist::Playlist()
{ {
// Default playlists // Default playlists
@ -144,6 +155,7 @@ namespace Components
//Got playlists is true //Got playlists is true
//Utils::Hook::Set<bool>(0x1AD3680, true); //Utils::Hook::Set<bool>(0x1AD3680, true);
Utils::Hook(0x497DB5, Playlist::GetMapIndex, HOOK_CALL).Install()->Quick();
Utils::Hook(0x42A19D, Playlist::MapNameCopy, HOOK_CALL).Install()->Quick(); Utils::Hook(0x42A19D, Playlist::MapNameCopy, HOOK_CALL).Install()->Quick();
Utils::Hook(0x4A6FEE, Playlist::SetMapName, HOOK_CALL).Install()->Quick(); Utils::Hook(0x4A6FEE, Playlist::SetMapName, HOOK_CALL).Install()->Quick();

View File

@ -27,5 +27,6 @@ namespace Components
static void MapNameCopy(char *dest, const char *src, int destsize); static void MapNameCopy(char *dest, const char *src, int destsize);
static void SetMapName(const char* cvar, const char* value); static void SetMapName(const char* cvar, const char* value);
static int GetMapIndex(const char* mapname);
}; };
} }

View File

@ -1284,6 +1284,10 @@ namespace Components
if (Zones::Version() >= 360) if (Zones::Version() >= 360)
{ {
char** varGfxImagePtr = reinterpret_cast<char**>(0x112B4A0);
char** varwindowDef_t = reinterpret_cast<char**>(0x112AF94);
*varGfxImagePtr = *varwindowDef_t + 164;
Game::Load_GfxImagePtr(atStreamStart); Game::Load_GfxImagePtr(atStreamStart);
} }
} }

View File

@ -151,6 +151,7 @@ namespace Game
NET_OutOfBandData_t NET_OutOfBandData = (NET_OutOfBandData_t)0x49C7E0; NET_OutOfBandData_t NET_OutOfBandData = (NET_OutOfBandData_t)0x49C7E0;
Live_MPAcceptInvite_t Live_MPAcceptInvite = (Live_MPAcceptInvite_t)0x420A6D; Live_MPAcceptInvite_t Live_MPAcceptInvite = (Live_MPAcceptInvite_t)0x420A6D;
Live_GetMapIndex_t Live_GetMapIndex = (Live_GetMapIndex_t)0x4F6440;
LoadModdableRawfile_t LoadModdableRawfile = (LoadModdableRawfile_t)0x61ABC0; LoadModdableRawfile_t LoadModdableRawfile = (LoadModdableRawfile_t)0x61ABC0;

View File

@ -371,6 +371,9 @@ namespace Game
typedef void(__cdecl * Live_MPAcceptInvite_t)(_XSESSION_INFO *hostInfo, const int controllerIndex, bool fromGameInvite); typedef void(__cdecl * Live_MPAcceptInvite_t)(_XSESSION_INFO *hostInfo, const int controllerIndex, bool fromGameInvite);
extern Live_MPAcceptInvite_t Live_MPAcceptInvite; extern Live_MPAcceptInvite_t Live_MPAcceptInvite;
typedef int(__cdecl * Live_GetMapIndex_t)(const char* mapname);
extern Live_GetMapIndex_t Live_GetMapIndex;
typedef char* (__cdecl * LoadModdableRawfile_t)(int a1, const char* filename); typedef char* (__cdecl * LoadModdableRawfile_t)(int a1, const char* filename);
extern LoadModdableRawfile_t LoadModdableRawfile; extern LoadModdableRawfile_t LoadModdableRawfile;