One more example
Bonus question:
what does this do?
PHP Code:
RageHookReturn OnRestartRound(void*& multiplay,int& ret)
{
#ifdef __linux__
int offset = 200;
#else
int offset = 208;
#endif
int& val = *(int*)(&(((char*)multiplay)[offset]));
if(val == 0)
val = 1;
return RageHookHandled;
}
void OnLoadFunction(FunctionForModule* function)
{
if(!strcmp(function->get_name(),"CHalfLifeMultiplay::RestartRound"))
{
function->add_module_hook((void*)&OnRestartRound,RageHookPre);
}
}