sourcemm/CSmmAPI.cpp
changeset 294 0d87bc8606f8
parent 292 1a828b239258
child 296 ba7337defd34
     1.1 --- a/sourcemm/CSmmAPI.cpp	Tue Feb 27 03:37:01 2007 +0000
     1.2 +++ b/sourcemm/CSmmAPI.cpp	Fri Mar 02 02:43:22 2007 +0000
     1.3 @@ -541,13 +541,13 @@
     1.4  	SourceHook::MemFuncInfo info = {true, -1, 0, 0};
     1.5  	SourceHook::GetFuncInfo(&IServerGameDLL::GetUserMessageInfo, info);
     1.6  
     1.7 -	// Get address of original GetUserMessageInfo()
     1.8 +	/* Get address of original GetUserMessageInfo() */
     1.9  	char *vfunc = reinterpret_cast<char *>(g_GameDllPatch->GetOrigFunc(info.vtbloffs, info.vtblindex));
    1.10  
    1.11 -	// If we can't get original function (GetOrigFunc bug?)
    1.12 +	/* If we can't get original function, that means there's no hook */
    1.13  	if (vfunc == NULL)
    1.14  	{
    1.15 -		// This means there's no hook, so we must get it manually - Lovely code <:-(
    1.16 +		/* Get virtual function address 'manually' then */
    1.17  		char *adjustedptr = reinterpret_cast<char *>(g_GameDll.pGameDLL) + info.thisptroffs + info.vtbloffs;
    1.18  		char **vtable = *reinterpret_cast<char ***>(adjustedptr);
    1.19  
    1.20 @@ -558,25 +558,25 @@
    1.21  
    1.22  	if (vcmp(vfunc, MSGCLASS_SIG, MSGCLASS_SIGLEN))
    1.23  	{
    1.24 -		// Get address of CUserMessages instance
    1.25 +		/* Get address of CUserMessages instance */
    1.26  		char **userMsgClass = *reinterpret_cast<char ***>(vfunc + MSGCLASS_OFFS);
    1.27  
    1.28 -		// Get address of CUserMessages::m_UserMessages
    1.29 +		/* Get address of CUserMessages::m_UserMessages */
    1.30  		dict = reinterpret_cast<UserMsgDict *>(*userMsgClass);
    1.31  	} else if (vcmp(vfunc, MSGCLASS2_SIG, MSGCLASS2_SIGLEN)) {
    1.32  	#ifdef OS_WIN32
    1.33  		/* If we get here, the code is possibly inlined like in Dystopia */
    1.34  
    1.35 -		// Get the address of the CUtlRBTree
    1.36 +		/* Get the address of the CUtlRBTree */
    1.37  		char *rbtree = *reinterpret_cast<char **>(vfunc + MSGCLASS2_OFFS);
    1.38  
    1.39 -		// The CUtlDict should be 8 bytes before the CUtlRBTree (yeah I know this is hacky)
    1.40 +		/* CUtlDict should be 8 bytes before the CUtlRBTree (hacktacular!) */
    1.41  		dict = reinterpret_cast<UserMsgDict *>(rbtree - 8);
    1.42  	#elif defined OS_LINUX
    1.43 -		// Get address of CUserMessages instance
    1.44 +		/* Get address of CUserMessages instance */
    1.45  		char **userMsgClass = *reinterpret_cast<char ***>(vfunc + MSGCLASS2_OFFS);
    1.46  
    1.47 -		// Get address of CUserMessages::m_UserMessages
    1.48 +		/* Get address of CUserMessages::m_UserMessages */
    1.49  		dict = reinterpret_cast<UserMsgDict *>(*userMsgClass);
    1.50  	#endif
    1.51  	}
    1.52 @@ -585,7 +585,7 @@
    1.53  	{
    1.54  		m_MsgCount = dict->Count();
    1.55  
    1.56 -		// Make sure count falls within bounds of an unsigned byte (engine sends message types as such)
    1.57 +		/* Ensure that count is within bounds of an unsigned byte, because that's what engine supports */
    1.58  		if (m_MsgCount < 0 || m_MsgCount > 255)
    1.59  		{
    1.60  			m_MsgCount = -1;
    1.61 @@ -594,7 +594,7 @@
    1.62  
    1.63  		UserMessage *msg;
    1.64  
    1.65 -		// Cache messages in our CUtlDict
    1.66 +		/* Cache messages in our CUtlDict */
    1.67  		for (int i = 0; i < m_MsgCount; i++)
    1.68  		{
    1.69  			msg = dict->Element(i);