From 1cd4cfe0fdf7bd7fc8faff68f0b25877f52a413b Mon Sep 17 00:00:00 2001 From: danij Date: Fri, 6 Mar 2015 20:03:21 +0000 Subject: [PATCH] libcommon: Cleanup --- doomsday/plugins/common/include/mobj.h | 20 ++++++++++---------- doomsday/plugins/common/src/mobj.cpp | 10 ++++++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/doomsday/plugins/common/include/mobj.h b/doomsday/plugins/common/include/mobj.h index b8a4fbc1ec..0444855d8b 100644 --- a/doomsday/plugins/common/include/mobj.h +++ b/doomsday/plugins/common/include/mobj.h @@ -154,6 +154,13 @@ dd_bool P_MobjChangeState(mobj_t *mob, statenum_t stateNum); */ dd_bool P_MobjChangeStateNoAction(mobj_t *mob, statenum_t stateNum); +/** + * Check whether the mobj is currently obstructed and explode immediately if so. + * + * @return Pointer to @em this mobj iff it survived, otherwise @c nullptr. + */ +mobj_t *Mobj_ExplodeIfObstructed(mobj_t *mob); + /** * Launch the given map-object @a missile (if any) at the specified @a angle. * @@ -166,20 +173,13 @@ dd_bool P_MobjChangeStateNoAction(mobj_t *mob, statenum_t stateNum); */ mobj_t *P_LaunchMissile(mobj_t *missile, angle_t angle, coord_t const targetPos[3], coord_t extraMomZ); -/** - * Check whether the mobj is currently obstructed and explode immediately if so. - * - * @return Pointer to @em this mobj iff it survived, otherwise @c nullptr. - */ -mobj_t *Mobj_ExplodeIfObstructed(mobj_t *mob); - /** * Launch the given map-object @a missile (if any) at the specified @a angle, * enqueuing a new launch sound and recording @em this map-object as the source. * * @param mob Map-object hurler of @a missile. - * @param angle World space angle at which to launch. * @param missile Map-object to be launched. + * @param angle World space angle at which to launch. * @param targetPos World space point being targeted (for determining speed). * @param extraMomZ Additional momentum to apply to the missile. * @@ -195,8 +195,8 @@ mobj_t *Mobj_LaunchMissileAtAngle (mobj_t *mob, mobj_t *missile, angle_t angle, * @a missile is presently facing. * * @param mob Map-object hurler of @a missile. - * @param missile Map-object to be hurdled. - * @param targetPos World space point being launchd at (for determining speed). + * @param missile Map-object to be launched. + * @param targetPos World space point being targeted (for determining speed). * @param extraMomZ Additional momentum to apply to the missile. * * @return Same as @a missile, for caller convenience. diff --git a/doomsday/plugins/common/src/mobj.cpp b/doomsday/plugins/common/src/mobj.cpp index 5ddb8cc798..1b83187c8d 100644 --- a/doomsday/plugins/common/src/mobj.cpp +++ b/doomsday/plugins/common/src/mobj.cpp @@ -229,10 +229,10 @@ dd_bool Mobj_IsPlayerClMobj(mobj_t *mo) return false; } -dd_bool Mobj_IsPlayer(mobj_t const *mo) +dd_bool Mobj_IsPlayer(mobj_t const *mob) { - if(!mo) return false; - return (mo->player != 0); + if(!mob) return false; + return (mob->player != 0); } angle_t Mobj_AimAtPoint2(mobj_t *mob, coord_t const point[], dd_bool pointShadowed) @@ -954,9 +954,11 @@ mobj_t *Mobj_ExplodeIfObstructed(mobj_t *mob) mobj_t *P_LaunchMissile(mobj_t *missile, angle_t angle, coord_t const targetPos[], coord_t extraMomZ) { - DENG_ASSERT(targetPos); + DENG2_ASSERT(targetPos); if(missile) { + DENG2_ASSERT(missile->info); + // Play the launch sound. if(missile->info->seeSound) {