diff --git a/game/client/portal/portalrenderable_flatbasic.cpp b/game/client/portal/portalrenderable_flatbasic.cpp index 35bfef80..2406d533 100644 --- a/game/client/portal/portalrenderable_flatbasic.cpp +++ b/game/client/portal/portalrenderable_flatbasic.cpp @@ -373,18 +373,22 @@ bool CPortalRenderable_FlatBasic::CalcFrustumThroughPortal( const Vector &ptCurr if( i2 < i3 ) { VPlane *v2 = &Planes[iMinSideFirstPoint]; - memcpy( v2, v2 + 1, sizeof( VPlane ) * (iVertCount - iMinSideFirstPoint) ); + + for( int i = 0; i < (iVertCount - iMinSideFirstPoint); i++ ) + v2[i] = v2[i+1]; } if( i3 < i4 ) //not the last point in the array { int iElementShift = (iOldVertCount - i4); + float *l3 = &fLineLengthSqr[i3]; //eliminate p3, we merged p2+p3 and already stored the result in p2 - memcpy( p3, p3 + 1, sizeof( Vector ) * iElementShift ); - - float *l3 = &fLineLengthSqr[i3]; - memcpy( l3, l3 + 1, sizeof( float ) * iElementShift ); + for( int i = 0; i < iElementShift; i++ ) + { + p3[i] = p3[i+1]; + l3[i] = l3[i+1]; + } } } diff --git a/game/shared/portal/StaticCollisionPolyhedronCache.cpp b/game/shared/portal/StaticCollisionPolyhedronCache.cpp index 7f910608..c9f55e27 100644 --- a/game/shared/portal/StaticCollisionPolyhedronCache.cpp +++ b/game/shared/portal/StaticCollisionPolyhedronCache.cpp @@ -265,7 +265,7 @@ void CStaticCollisionPolyhedronCache::Update( void ) m_BrushPolyhedrons[i] = pDest; pFinalDest += memRequired; - int memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource); + intp memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource); memcpy( pDest, pSource, memRequired ); //move all the pointers to their new location. @@ -425,7 +425,7 @@ void CStaticCollisionPolyhedronCache::Update( void ) m_StaticPropPolyhedrons[i] = pDest; pFinalDest += memRequired; - int memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource); + intp memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource); memcpy( pDest, pSource, memRequired ); //move all the pointers to their new location.