ref: 2d88fd0d7f6164832b5f6ca0e1026fcaf78799d1
parent: 2fe30c8eb736087233409b4aea28fe36e3314517
author: mfrancis95 <mikefrancis95@gmail.com>
date: Sun Dec 8 19:18:45 EST 2019
Remove unnecessary non-null mobj checks in hexen/a_action.c. These checks are safe to remove because the mobj is already being dereferenced
--- a/src/hexen/a_action.c
+++ b/src/hexen/a_action.c
@@ -153,12 +153,9 @@
{
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_POTTERYBIT1);
P_SetMobjState(mo, mo->info->spawnstate + (P_Random() % 5));
- if (mo)
- {
- mo->momz = ((P_Random() & 7) + 5) * (3 * FRACUNIT / 4);
- mo->momx = P_SubRandom() << (FRACBITS - 6);
- mo->momy = P_SubRandom() << (FRACBITS - 6);
- }
+ mo->momz = ((P_Random() & 7) + 5) * (3 * FRACUNIT / 4);
+ mo->momx = P_SubRandom() << (FRACBITS - 6);
+ mo->momy = P_SubRandom() << (FRACBITS - 6);
}
S_StartSound(mo, SFX_POTTERY_EXPLODE);
if (actor->args[0])
@@ -262,12 +259,9 @@
{
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_CORPSEBIT);
P_SetMobjState(mo, mo->info->spawnstate + (P_Random() % 3));
- if (mo)
- {
- mo->momz = ((P_Random() & 7) + 5) * (3 * FRACUNIT / 4);
- mo->momx = P_SubRandom() << (FRACBITS - 6);
- mo->momy = P_SubRandom() << (FRACBITS - 6);
- }
+ mo->momz = ((P_Random() & 7) + 5) * (3 * FRACUNIT / 4);
+ mo->momx = P_SubRandom() << (FRACBITS - 6);
+ mo->momy = P_SubRandom() << (FRACBITS - 6);
}
// Spawn a skull
mo = P_SpawnMobj(actor->x, actor->y, actor->z, MT_CORPSEBIT);
@@ -1177,12 +1171,9 @@
actor->z + (r1 * actor->height / 256),
MT_ZARMORCHUNK);
P_SetMobjState(mo, mo->info->spawnstate + i);
- if (mo)
- {
- mo->momz = ((P_Random() & 7) + 5) * FRACUNIT;
- mo->momx = P_SubRandom() << (FRACBITS - 6);
- mo->momy = P_SubRandom() << (FRACBITS - 6);
- }
+ mo->momz = ((P_Random() & 7) + 5) * FRACUNIT;
+ mo->momx = P_SubRandom() << (FRACBITS - 6);
+ mo->momy = P_SubRandom() << (FRACBITS - 6);
}
if (actor->args[0])
{ // Spawn an item