shithub: choc

Download patch

ref: af9838404b695a26ee18df205affc4a4e0af40f2
parent: 2d88fd0d7f6164832b5f6ca0e1026fcaf78799d1
author: mfrancis95 <mikefrancis95@gmail.com>
date: Sun Dec 8 19:20:37 EST 2019

Remove unnecessary non-null mobj checks in hexen/p_enemy.c. These checks are safe to remove because the mobj is already being dereferenced

--- a/src/hexen/p_enemy.c
+++ b/src/hexen/p_enemy.c
@@ -4876,13 +4876,10 @@
                          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 @@
                          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