diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2015-04-12 02:32:12 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2015-04-12 02:32:12 +0200 |
commit | 622ecb7bedeacaf4063dadc87764d3b66ad2f009 (patch) | |
tree | 6a936666d9d495d59bb7a0cc294b1077213550fe /src/cgame | |
parent | eca487d693704aed6beb821222481724f3aeedd4 (diff) |
Make force fields apply forces smoothly and continuously.
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_predict.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cgame/cg_predict.c b/src/cgame/cg_predict.c index 9baab8b..bba333c 100644 --- a/src/cgame/cg_predict.c +++ b/src/cgame/cg_predict.c @@ -620,6 +620,23 @@ void CG_PredictPlayerState( void ) cg_pmove.noFootsteps = 0; +/* for( i = 0; i < cg.snap->numEntities; i++ ) + { + cent = &cg_entities[ cg.snap->entities[ i ].number ]; + es = ¢->currentState;*/ + + for( cg_pmove.numForceFields = 0, i = 0; i < cg.snap->numEntities; i++ ) + { + centity_t *cent = cg_entities + cg.snap->entities[ i ].number; + + if( BG_ForceFieldForEntity( &cg.predictedPlayerState, ¢->currentState, + cg_pmove.forceFields + cg_pmove.numForceFields ) ) + cg_pmove.numForceFields++; + + if( cg_pmove.numForceFields == MAX_FORCE_FIELDS ) + break; + } + // save the state before the pmove so we can detect transitions oldPlayerState = cg.predictedPlayerState; |