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"); } }