All pastes #75212 Raw Edit

Anonymous

public text v1 · immutable
#75212 ·published 2006-06-29 22:45 UTC
rendered paste body
void UTIL_SetSurroundType(edict_t *pEntity, SurroundingBoundsType_t SurroundType)
{
	static int SurroundOffset = 0;

	if (SurroundOffset==0)
	{
		datamap_t *dmap = gVFunc.GetDataDescMap(pEntity->GetUnknown()->GetBaseEntity());
		if (dmap)
		{
			SurroundOffset = UTIL_FindOffsetDMap(dmap, "m_nSurroundType");
		}
		else
		{
			META_LOG(g_PLAPI, "*** error *** did not obtain datamap\n");
		}
	}

	if (SurroundOffset!=0)
	{
		*(int *)((char *)pEntity->GetUnknown()->GetBaseEntity() + SurroundOffset ) = SurroundType;
	}
	else
	{
		META_LOG(g_PLAPI, "*** error *** could not find SurroundOffset\n");
	}
}