From 800dcc6302f303e33a318f9e74c21515ffad1243 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 22 May 2022 22:02:31 -0400 Subject: [PATCH] Revert "Some asserts in hyu code" This reverts commit 0ce466e7efacd1e97971ae1fb2bee9f6e6390a9d. --- src/objects/hyudoro.c | 54 ++++++------------------------------------- 1 file changed, 7 insertions(+), 47 deletions(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index b5ece9157..e8fc14de3 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -37,55 +37,21 @@ K_ChangePlayerItem #define hyudoro_itemtype(o) ((o)->movefactor) #define hyudoro_itemcount(o) ((o)->movecount) #define hyudoro_hover_stack(o) ((o)->threshold) - -static mobj_t * -hyudoro_next (mobj_t *o) -{ - I_Assert(o != NULL && P_MobjWasRemoved(o) == false); - I_Assert(o->tracer != NULL && P_MobjWasRemoved(o->tracer) == false); - - return o->tracer; -} - +#define hyudoro_next(o) ((o)->tracer) #define hyudoro_stackpos(o) ((o)->reactiontime) -// these next two functions cannot be combined -static mobj_t * -hyudoro_center (mobj_t *o) -{ - I_Assert(o != NULL && P_MobjWasRemoved(o) == false); - I_Assert(o->target != NULL && P_MobjWasRemoved(o->target) == false); - - return o->target; -} - -static mobj_t * -hyudoro_target (mobj_t *o) -{ - I_Assert(o != NULL && P_MobjWasRemoved(o) == false); - I_Assert(o->target != NULL && P_MobjWasRemoved(o->target) == false); - - return o->target; -} +// cannot be combined +#define hyudoro_center(o) ((o)->target) +#define hyudoro_target(o) ((o)->target) #define hyudoro_center_max_radius(o) ((o)->threshold) - -static mobj_t * -hyudoro_center_master (mobj_t *o) -{ - I_Assert(o != NULL && P_MobjWasRemoved(o) == false); - I_Assert(o->target != NULL && P_MobjWasRemoved(o->target) == false); - - return o->target; -} +#define hyudoro_center_master(o) ((o)->target) static angle_t trace_angle (mobj_t *hyu) { mobj_t *center = hyu->target; - I_Assert(center != NULL && P_MobjWasRemoved(center) == false); - if (hyu->x != center->x || hyu->y != center->y) { return R_PointToAngle2( @@ -100,15 +66,13 @@ get_look_angle (mobj_t *thing) { player_t *player = thing->player; - I_Assert(player != NULL); - return player ? player->angleturn : thing->angle; } static boolean is_hyudoro (mobj_t *thing) { - return thing != NULL && P_MobjWasRemoved(thing) == false && thing->type == MT_HYUDORO; + return thing && thing->type == MT_HYUDORO; } static mobj_t * @@ -116,8 +80,6 @@ get_hyudoro_master (mobj_t *hyu) { mobj_t *center = hyudoro_center(hyu); - I_Assert(center != NULL && P_MobjWasRemoved(center) == false); - return center ? hyudoro_center_master(center) : NULL; } @@ -135,8 +97,6 @@ sine_bob angle_t a, fixed_t sineofs) { - I_Assert(hyu != NULL && P_MobjWasRemoved(hyu) == false); - hyu->sprzoff = FixedMul(hyu->height, sineofs + FINESINE(a >> ANGLETOFINESHIFT)); } @@ -220,7 +180,7 @@ move_to_player (mobj_t *hyu) angle_t angle; - if (target == NULL || P_MobjWasRemoved(target) == true) + if (!target) return; angle = R_PointToAngle2(