From 0a16855232f8a35748052c7ba70c46baf3af48a9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 2 Apr 2015 10:05:32 +0200 Subject: [PATCH] - fixed: The assignment to the 'player' variable in P_DamageMobj occured too late, skipping a few cases. - changed monster unblocking logic to include players as well (i.e. a player being stuck inside another actor is allowed to move away from that other actor.) --- src/p_interaction.cpp | 3 ++- src/p_map.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index edcd28c91..3f4147c33 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1033,6 +1033,8 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, { target->velx = target->vely = target->velz = 0; } + + player = target->player; if (!(flags & DMG_FORCED)) // DMG_FORCED skips all special damage checks, TELEFRAG_DAMAGE may not be reduced at all { if (target->flags2 & MF2_DORMANT) @@ -1043,7 +1045,6 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, if (damage < TELEFRAG_DAMAGE) // TELEFRAG_DAMAGE may not be reduced at all or it may not guarantee its effect. { - player = target->player; if (player && damage > 1) { // Take half damage in trainer mode diff --git a/src/p_map.cpp b/src/p_map.cpp index 2362fbd12..1ad1728ce 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1034,7 +1034,7 @@ bool PIT_CheckThing(AActor *thing, FCheckPosition &tm) // Both things overlap in x or y direction bool unblocking = false; - if (tm.FromPMove) + if (tm.FromPMove || tm.thing->player != NULL) { // Both actors already overlap. To prevent them from remaining stuck allow the move if it // takes them further apart or the move does not change the position (when called from P_ChangeSector.)