summaryrefslogtreecommitdiff
path: root/src/game/g_active.c
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2015-04-12 02:32:12 +0200
committerPaweł Redman <pawel.redman@gmail.com>2015-04-12 02:32:12 +0200
commit622ecb7bedeacaf4063dadc87764d3b66ad2f009 (patch)
tree6a936666d9d495d59bb7a0cc294b1077213550fe /src/game/g_active.c
parenteca487d693704aed6beb821222481724f3aeedd4 (diff)
Make force fields apply forces smoothly and continuously.
Diffstat (limited to 'src/game/g_active.c')
-rw-r--r--src/game/g_active.c13
1 files changed, 13 insertions, 0 deletions
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;