commit af9838404b695a26ee18df205affc4a4e0af40f2
Author: mfrancis95 <mikefrancis95@gmail.com>
AuthorDate: Mon Dec 9 00:20:37 2019 -0500
Commit: mfrancis95 <mikefrancis95@gmail.com>
CommitDate: Thu Dec 12 07:55:43 2019 -0500
Remove unnecessary non-null mobj checks in hexen/p_enemy.c. These checks are safe to remove because the mobj is already being dereferenced
---
src/hexen/p_enemy.c | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/src/hexen/p_enemy.c b/src/hexen/p_enemy.c
index ff265c8e..d805ca9f 100644
--- a/src/hexen/p_enemy.c
+++ b/src/hexen/p_enemy.c
@@ -4876,13 +4876,10 @@ void A_FreezeDeathChunks(mobj_t * actor)
actor->z + (r1 * actor->height / 255),
MT_ICECHUNK);
P_SetMobjState(mo, mo->info->spawnstate + (P_Random() % 3));
- if (mo)
- {
- mo->momz = FixedDiv(mo->z - actor->z, actor->height) << 2;
- mo->momx = P_SubRandom() << (FRACBITS - 7);
- mo->momy = P_SubRandom() << (FRACBITS - 7);
- A_IceSetTics(mo); // set a random tic wait
- }
+ mo->momz = FixedDiv(mo->z - actor->z, actor->height) << 2;
+ mo->momx = P_SubRandom() << (FRACBITS - 7);
+ mo->momy = P_SubRandom() << (FRACBITS - 7);
+ A_IceSetTics(mo); // set a random tic wait
}
for (i = 12 + (P_Random() & 15); i >= 0; i--)
{
@@ -4896,13 +4893,10 @@ void A_FreezeDeathChunks(mobj_t * actor)
actor->z + (r1 * actor->height / 255),
MT_ICECHUNK);
P_SetMobjState(mo, mo->info->spawnstate + (P_Random() % 3));
- if (mo)
- {
- mo->momz = FixedDiv(mo->z - actor->z, actor->height) << 2;
- mo->momx = P_SubRandom() << (FRACBITS - 7);
- mo->momy = P_SubRandom() << (FRACBITS - 7);
- A_IceSetTics(mo); // set a random tic wait
- }
+ mo->momz = FixedDiv(mo->z - actor->z, actor->height) << 2;
+ mo->momx = P_SubRandom() << (FRACBITS - 7);
+ mo->momy = P_SubRandom() << (FRACBITS - 7);
+ A_IceSetTics(mo); // set a random tic wait
}
if (actor->player)
{ // attach the player's view to a chunk of ice