diff options
| author | Joe Ludwig <[email protected]> | 2014-05-15 13:59:18 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2014-05-15 13:59:18 -0700 |
| commit | 53e78c503e6e9c7d15e2eefc480755fe37dd7077 (patch) | |
| tree | c8cc106eb4c0a2b2b5d79f534f2facb0514f5f55 /mp/src/game/shared/particle_property.cpp | |
| parent | Added many shader source files (diff) | |
| download | source-sdk-2013-53e78c503e6e9c7d15e2eefc480755fe37dd7077.tar.xz source-sdk-2013-53e78c503e6e9c7d15e2eefc480755fe37dd7077.zip | |
General:
* Upgraded Steamworks SDK to v1.29
* Fixed mod compatibility problem with Multiplayer Base that was introduced in September.
* In Hammer, while using the Vertex Tool, pressing CTRL+B will snap selected vertices to the grid.
Virtual Reality:
* Mods that support virtual reality now need to have a line in gameinfo.txt that says “supportsvr 1”. This indicates to gameui and engine that certain UI should be enabled.
* VR-enabled mods will now start up in VR mode when launched from Steam’s VR mode.
Windows:
* Upgraded to Visual Studio 2013. If you need to build projects for VS 2010, add /2010 to your VPC command line.
OSX:
* Upgraded to XCode 5.
Diffstat (limited to 'mp/src/game/shared/particle_property.cpp')
| -rw-r--r-- | mp/src/game/shared/particle_property.cpp | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/mp/src/game/shared/particle_property.cpp b/mp/src/game/shared/particle_property.cpp index 8ddc9784..c1c44a1a 100644 --- a/mp/src/game/shared/particle_property.cpp +++ b/mp/src/game/shared/particle_property.cpp @@ -200,8 +200,23 @@ void CParticleProperty::AddControlPoint( int iEffectIndex, int iPoint, C_BaseEnt ParticleEffectList_t *pEffect = &m_ParticleEffects[iEffectIndex]; Assert( pEffect->pControlPoints.Count() < MAX_PARTICLE_CONTROL_POINTS ); - int iIndex = pEffect->pControlPoints.AddToTail(); - ParticleControlPoint_t *pNewPoint = &pEffect->pControlPoints[iIndex]; + // If the control point is already used, override it + ParticleControlPoint_t *pNewPoint = NULL; + int iIndex = iPoint; + FOR_EACH_VEC( pEffect->pControlPoints, i ) + { + if ( pEffect->pControlPoints[i].iControlPoint == iPoint ) + { + pNewPoint = &pEffect->pControlPoints[i]; + } + } + + if ( !pNewPoint ) + { + iIndex = pEffect->pControlPoints.AddToTail(); + pNewPoint = &pEffect->pControlPoints[iIndex]; + } + pNewPoint->iControlPoint = iPoint; pNewPoint->hEntity = pEntity; pNewPoint->iAttachType = iAttachType; @@ -553,7 +568,7 @@ void CParticleProperty::UpdateControlPoint( ParticleEffectList_t *pEffect, int i if ( pAnimating ) { int bUseHeadOrigin = 0; - CALL_ATTRIB_HOOK_INT_ON_OTHER( pPoint->hEntity.Get(), bUseHeadOrigin, particle_effect_use_head_origin ); + CALL_ATTRIB_HOOK_INT_ON_OTHER( pAnimating, bUseHeadOrigin, particle_effect_use_head_origin ); if ( bUseHeadOrigin > 0 ) { int iBone = Studio_BoneIndexByName( pAnimating->GetModelPtr(), "bip_head" ); @@ -565,15 +580,17 @@ void CParticleProperty::UpdateControlPoint( ParticleEffectList_t *pEffect, int i iBone = Studio_BoneIndexByName( pAnimating->GetModelPtr(), "prp_hat" ); } } - if ( iBone >= 0 ) + if ( iBone < 0 ) { - bUsingHeadOrigin = true; - const matrix3x4_t headBone = pAnimating->GetBone( iBone ); - MatrixVectors( headBone, &vecForward, &vecRight, &vecUp ); - MatrixPosition( headBone, vecOrigin ); - - CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pPoint->hEntity.Get(), flOffset, particle_effect_vertical_offset ); + iBone = 0; } + + bUsingHeadOrigin = true; + const matrix3x4_t headBone = pAnimating->GetBone( iBone ); + MatrixVectors( headBone, &vecForward, &vecRight, &vecUp ); + MatrixPosition( headBone, vecOrigin ); + + CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pAnimating, flOffset, particle_effect_vertical_offset ); } } } |