From 8b9d8137fcf6009eaedb72afc65a2f0c1c8a3bd2 Mon Sep 17 00:00:00 2001
From: Christoph Oelckers <coelckers@zdoom.fake>
Date: Sun, 24 Jan 2010 09:46:31 +0000
Subject: [PATCH] - fixed: P_SpawnPuff must set the puff's owner before doing
 any state jumps.

SVN r2128 (trunk)
---
 src/p_mobj.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp
index 599f78772d..7db9920197 100644
--- a/src/p_mobj.cpp
+++ b/src/p_mobj.cpp
@@ -4446,6 +4446,11 @@ AActor *P_SpawnPuff (AActor *source, const PClass *pufftype, fixed_t x, fixed_t
 
 	puff = Spawn (pufftype, x, y, z, ALLOW_REPLACE);
 	if (puff == NULL) return NULL;
+
+	// [BB] If the puff came from a player, set the target of the puff to this player.
+	if ( puff && (puff->flags5 & MF5_PUFFGETSOWNER))
+		puff->target = source;
+
 	if (source != NULL) puff->angle = R_PointToAngle2(x, y, source->x, source->y);
 
 	// If a puff has a crash state and an actor was not hit,
@@ -4481,10 +4486,6 @@ AActor *P_SpawnPuff (AActor *source, const PClass *pufftype, fixed_t x, fixed_t
 		}
 	}
 
-	// [BB] If the puff came from a player, set the target of the puff to this player.
-	if ( puff && (puff->flags5 & MF5_PUFFGETSOWNER))
-		puff->target = source;
-
 	return puff;
 }