# HG changeset patch
# User Ru5tK1ng
# Date 1704841048 21600
#      Tue Jan 09 16:57:28 2024 -0600
# Branch morphog
# Node ID 0dd423e572731e2b6f92dceb09652458f86d26d1
# Parent  17757ad8e820f40edf930d64f27b5641c62d1fa6
Porkalator and Morph Ovum couldn't spawn bloodsplatter actors online (addresses 3007).

diff -r 17757ad8e820 -r 0dd423e57273 docs/zandronum-history.txt
--- a/docs/zandronum-history.txt	Thu Jan 04 17:01:19 2024 -0600
+++ b/docs/zandronum-history.txt	Tue Jan 09 16:57:28 2024 -0600
@@ -111,6 +111,7 @@
 -	- Fixed: opening the text scaling menu sometimes changed the user's con_virtualwidth and/or con_virtualheight CVars when it shouldn't. [Kaminsky]
 -	- Fixed: the coop info wasn't getting drawn in clientside demos. [Kaminsky]
 -	- Fixed: Floatbob items having incorrect z-height after a map reset and glitchy GL floor clipping (addresses 2361). [Ru5tK1ng]
+-   - Fixed: Porkalator and Morph Ovum couldn't spawn bloodsplatter actors online (addresses 3007). [Ru5tK1ng]
 !	- The result value of GAMEEVENT_MEDALS event scripts can now be used to determine whether or not the player receives the medal. [Kaminsky]
 !	- GAMEMODE flags are now validated after all GAMEMODE lumps have been parsed instead of after each one. The internal game mode name (e.g. "TeamLMS") is now printed with the error message instead of the actual name. [Kaminsky]
 !	- Added an extra check to ensure that game modes have a (short) name. [Kaminsky]
diff -r 17757ad8e820 -r 0dd423e57273 src/p_map.cpp
--- a/src/p_map.cpp	Thu Jan 04 17:01:19 2024 -0600
+++ b/src/p_map.cpp	Tue Jan 09 16:57:28 2024 -0600
@@ -1297,7 +1297,12 @@
 						!(tm.thing->flags3 & MF3_BLOODLESSIMPACT) &&
 						(pr_checkthing() < 192))
 					{
-						P_BloodSplatter(tm.thing->x, tm.thing->y, tm.thing->z, thing);
+						// [RK] If it's a morph projectile we'll spawn the splatter at it's orgin since
+						// the original actor was destroyed during morphing when it was damaged above.
+						if(tm.thing->GetClass()->IsDescendantOf(PClass::FindClass("MorphProjectile")))
+							P_BloodSplatter(tm.thing->x, tm.thing->y, tm.thing->z, tm.thing);
+						else
+							P_BloodSplatter(tm.thing->x, tm.thing->y, tm.thing->z, thing);
 					}
 					if (!(tm.thing->flags3 & MF3_BLOODLESSIMPACT))
 					{
