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/game/g_active.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/game/g_active.c') diff --git a/src/game/g_active.c b/src/game/g_active.c index 0c84f57..1f0d121 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -1663,6 +1663,7 @@ void ClientThink_real( gentity_t *ent ) int oldEventSequence; int msec; usercmd_t *ucmd; + int i; client = ent->client; @@ -1992,6 +1993,18 @@ void ClientThink_real( gentity_t *ent ) pm.debugLevel = g_debugMove.integer; pm.noFootsteps = 0; + for( i = 0; i < level.num_entities; i++ ) + { + gentity_t *ent = g_entities + i; + + if( BG_ForceFieldForEntity( pm.ps, &ent->s, + pm.forceFields + pm.numForceFields ) ) + pm.numForceFields++; + + if( pm.numForceFields == MAX_FORCE_FIELDS ) + break; + } + pm.pmove_fixed = pmove_fixed.integer | client->pers.pmoveFixed; pm.pmove_msec = pmove_msec.integer; -- cgit