1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2025-01-19 08:52:34 +01:00

Fixed crash on Alien Swarm when client connected (bug 4529, r=dvander).

This commit is contained in:
Scott Ehlert 2010-07-22 17:42:01 -05:00
parent 0884d2bdb0
commit 0ada46b1e9

View File

@ -128,6 +128,25 @@ public:
sizeof(void*),
SH_MEM_READ|SH_MEM_WRITE|SH_MEM_EXEC);
vtable_dest[mfp_dest.vtblindex] = vtable_src[mfp_src.vtblindex];
/* AS engine inserted ClientFullyConnect into the vtable, so move entries up on older engines */
if (mm_backend != MMBackend_AlienSwarm)
{
SourceHook::MemFuncInfo mfp_fconnect;
mfp_fconnect.isVirtual = false;
SourceHook::GetFuncInfo(&ServerPlugin::ClientFullyConnect, mfp_fconnect);
assert(mfp_fconnect.isVirtual);
assert(mfp_fconnect.thisptroffs == 0);
assert(mfp_fconnect.vtbloffs == 0);
/* Shifting ClientDisconnect through OnQueryCvarValueFinished up into slot for ClientFullyConnect (8 entries) */
SourceHook::SetMemAccess(&vtable_dest[mfp_fconnect.vtblindex],
sizeof(void *) * 8,
SH_MEM_READ|SH_MEM_WRITE|SH_MEM_EXEC);
memmove(&vtable_dest[mfp_fconnect.vtblindex], &vtable_dest[mfp_fconnect.vtblindex + 1], sizeof(void *) * 8);
}
}
char error[255];
@ -213,6 +232,9 @@ public:
virtual void ClientActive(edict_t *pEntity)
{
}
virtual void ClientFullyConnect(edict_t *pEntity)
{
}
virtual void ClientDisconnect(edict_t *pEntity)
{
}