From e46afda89620a85fbfcf47afeaac5b436a4e587c Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 01:04:49 -0400 Subject: [PATCH 1/4] Hopefully fix ghosts --- src/g_demo.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/g_demo.c b/src/g_demo.c index 9d3b86015..1367c87b9 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -784,6 +784,18 @@ void G_GhostTicker(void) mobj = P_SpawnGhostMobj(g->mo); // does a large portion of the work for us mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|tr_trans60<mo, 0, 0, g->mo->scale * 24, type); + mobj->angle = g->mo->angle + ANGLE_90; + mobj->fuse = 7; + mobj->scale = FRACUNIT / 3; + mobj->destscale = 10*FRACUNIT; + mobj->colorized = true; + mobj->color = g->mo->color; + mobj->momx = -g->mo->momx / 2; + mobj->momy = -g->mo->momy / 2; + } else { mobj = P_SpawnMobjFromMobj(g->mo, 0, 0, -FixedDiv(FixedMul(g->mo->info->height, g->mo->scale) - g->mo->height,3*FRACUNIT), MT_THOK); @@ -1074,6 +1086,18 @@ void G_ReadMetalTic(mobj_t *metal) { mobj = P_SpawnGhostMobj(metal); // does a large portion of the work for us } + else if (type == MT_THOKEFFECT) + { + mobj = P_SpawnMobjFromMobj(metal, 0, 0, metal->scale * 24, type); + mobj->angle = metal->angle + ANGLE_90; + mobj->fuse = 7; + mobj->scale = FRACUNIT / 3; + mobj->destscale = 10*FRACUNIT; + mobj->colorized = true; + mobj->color = metal->color; + mobj->momx = -metal->momx / 2; + mobj->momy = -metal->momy / 2; + } else { mobj = P_SpawnMobjFromMobj(metal, 0, 0, -FixedDiv(FixedMul(metal->info->height, metal->scale) - metal->height,3*FRACUNIT), MT_THOK); From 63d217b689ee4d39fc906a77e5b93b3557898fca Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Fri, 18 Jun 2021 05:06:52 +0000 Subject: [PATCH 2/4] Revert "Hopefully fix ghosts" This reverts commit e46afda89620a85fbfcf47afeaac5b436a4e587c --- src/g_demo.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/g_demo.c b/src/g_demo.c index 1367c87b9..9d3b86015 100644 --- a/src/g_demo.c +++ b/src/g_demo.c @@ -784,18 +784,6 @@ void G_GhostTicker(void) mobj = P_SpawnGhostMobj(g->mo); // does a large portion of the work for us mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|tr_trans60<mo, 0, 0, g->mo->scale * 24, type); - mobj->angle = g->mo->angle + ANGLE_90; - mobj->fuse = 7; - mobj->scale = FRACUNIT / 3; - mobj->destscale = 10*FRACUNIT; - mobj->colorized = true; - mobj->color = g->mo->color; - mobj->momx = -g->mo->momx / 2; - mobj->momy = -g->mo->momy / 2; - } else { mobj = P_SpawnMobjFromMobj(g->mo, 0, 0, -FixedDiv(FixedMul(g->mo->info->height, g->mo->scale) - g->mo->height,3*FRACUNIT), MT_THOK); @@ -1086,18 +1074,6 @@ void G_ReadMetalTic(mobj_t *metal) { mobj = P_SpawnGhostMobj(metal); // does a large portion of the work for us } - else if (type == MT_THOKEFFECT) - { - mobj = P_SpawnMobjFromMobj(metal, 0, 0, metal->scale * 24, type); - mobj->angle = metal->angle + ANGLE_90; - mobj->fuse = 7; - mobj->scale = FRACUNIT / 3; - mobj->destscale = 10*FRACUNIT; - mobj->colorized = true; - mobj->color = metal->color; - mobj->momx = -metal->momx / 2; - mobj->momy = -metal->momy / 2; - } else { mobj = P_SpawnMobjFromMobj(metal, 0, 0, -FixedDiv(FixedMul(metal->info->height, metal->scale) - metal->height,3*FRACUNIT), MT_THOK); From 58db5a6904943ef944f76ca45d260a1bc123463f Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Wed, 28 Jul 2021 15:42:44 +0000 Subject: [PATCH 3/4] Fix P_PlayerInPain crash. --- src/p_user.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index c5f919c78..f3ebc7dff 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -969,6 +969,9 @@ pflags_t P_GetJumpFlags(player_t *player) // boolean P_PlayerInPain(player_t *player) { + // If the player doesn't have a mobj, it can't be in pain. + if !(player->mo) + return false; // no silly, sliding isn't pain if (!(player->pflags & PF_SLIDING) && player->mo->state == &states[player->mo->info->painstate] && player->powers[pw_flashing]) return true; From d50e3bff70f1ac28fc74e85f8e93642a979f0b52 Mon Sep 17 00:00:00 2001 From: Radicalicious Date: Thu, 29 Jul 2021 15:55:19 +0000 Subject: [PATCH 4/4] ACTUALLY fix the issue. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index f3ebc7dff..740688b45 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -970,7 +970,7 @@ pflags_t P_GetJumpFlags(player_t *player) boolean P_PlayerInPain(player_t *player) { // If the player doesn't have a mobj, it can't be in pain. - if !(player->mo) + if (!player->mo) return false; // no silly, sliding isn't pain if (!(player->pflags & PF_SLIDING) && player->mo->state == &states[player->mo->info->painstate] && player->powers[pw_flashing])