fixed bug amb1132 - team finding code crashed ins from null deref
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401679
This commit is contained in:
		
							parent
							
								
									0aa30ccde2
								
							
						
					
					
						commit
						116553f7df
					
				@ -84,7 +84,11 @@ void SDKTools::OnServerActivate(edict_t *pEdictList, int edictCount, int clientM
 | 
			
		||||
		ServerClass *pClass = pEdict->GetNetworkable()->GetServerClass();
 | 
			
		||||
		if (FindTeamEntities(pClass->m_pTable, "DT_Team"))
 | 
			
		||||
		{
 | 
			
		||||
			static int offset = g_pGameHelpers->FindInSendTable(pClass->GetName(), "m_iTeamNum")->GetOffset();
 | 
			
		||||
			SendProp *pTeamNumProp = g_pGameHelpers->FindInSendTable(pClass->GetName(), "m_iTeamNum");
 | 
			
		||||
 | 
			
		||||
			if (pTeamNumProp != NULL)
 | 
			
		||||
			{
 | 
			
		||||
				int offset = pTeamNumProp->GetOffset();
 | 
			
		||||
				CBaseEntity *pEnt = pEdict->GetUnknown()->GetBaseEntity();
 | 
			
		||||
				int TeamIndex = *(int *)((unsigned char *)pEnt + offset);
 | 
			
		||||
 | 
			
		||||
@ -96,6 +100,7 @@ void SDKTools::OnServerActivate(edict_t *pEdictList, int edictCount, int clientM
 | 
			
		||||
				g_Teams[TeamIndex].pEnt = pEnt;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static cell_t GetTeamCount(IPluginContext *pContext, const cell_t *params)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user