From a895f508875a5052a6b3e7f6ccf96929259917dc Mon Sep 17 00:00:00 2001
From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Wed, 11 Mar 2009 20:27:15 +0000
Subject: [PATCH] changed sv_gameplayfix_delayprojectiles to also delay think
 functions on newly spawned entities, not just movement

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8800 d7cf8633-e32d-0410-b094-e92efae38249
---
 sv_phys.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sv_phys.c b/sv_phys.c
index 45d43e36..b05dee17 100644
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -2100,10 +2100,16 @@ void SV_Physics_Step (prvm_edict_t *ent)
 
 static void SV_Physics_Entity (prvm_edict_t *ent)
 {
-	// don't run a move on newly spawned projectiles as it messes up movement
-	// interpolation and rocket trails
+	// don't run think/move on newly spawned projectiles as it messes up
+	// movement interpolation and rocket trails, and is inconsistent with
+	// respect to entities spawned in the same frame
+	// (if an ent spawns a higher numbered ent, it moves in the same frame,
+	//  but if it spawns a lower numbered ent, it doesn't - this never moves
+	//  ents in the first frame regardless)
 	qboolean runmove = ent->priv.server->move;
 	ent->priv.server->move = true;
+	if (!runmove && sv_gameplayfix_delayprojectiles.integer)
+		return;
 	switch ((int) ent->fields.server->movetype)
 	{
 	case MOVETYPE_PUSH:
@@ -2140,7 +2146,7 @@ static void SV_Physics_Entity (prvm_edict_t *ent)
 	case MOVETYPE_FLYMISSILE:
 	case MOVETYPE_FLY:
 		// regular thinking
-		if (SV_RunThink (ent) && (runmove || !sv_gameplayfix_delayprojectiles.integer))
+		if (SV_RunThink (ent))
 			SV_Physics_Toss (ent);
 		break;
 	default:
-- 
2.39.5