From 622ecb7bedeacaf4063dadc87764d3b66ad2f009 Mon Sep 17 00:00:00 2001 From: PaweÅ‚ Redman Date: Sun, 12 Apr 2015 02:32:12 +0200 Subject: Make force fields apply forces smoothly and continuously. --- src/cgame/cg_predict.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/cgame/cg_predict.c') 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; -- cgit