Revert "Some asserts in hyu code"

This reverts commit 0ce466e7ef.
This commit is contained in:
Sally Coolatta 2022-05-22 22:02:31 -04:00
parent 61d61dcf25
commit 800dcc6302

View file

@ -37,55 +37,21 @@ K_ChangePlayerItem
#define hyudoro_itemtype(o) ((o)->movefactor) #define hyudoro_itemtype(o) ((o)->movefactor)
#define hyudoro_itemcount(o) ((o)->movecount) #define hyudoro_itemcount(o) ((o)->movecount)
#define hyudoro_hover_stack(o) ((o)->threshold) #define hyudoro_hover_stack(o) ((o)->threshold)
#define hyudoro_next(o) ((o)->tracer)
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_stackpos(o) ((o)->reactiontime) #define hyudoro_stackpos(o) ((o)->reactiontime)
// these next two functions cannot be combined // cannot be combined
static mobj_t * #define hyudoro_center(o) ((o)->target)
hyudoro_center (mobj_t *o) #define hyudoro_target(o) ((o)->target)
{
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;
}
#define hyudoro_center_max_radius(o) ((o)->threshold) #define hyudoro_center_max_radius(o) ((o)->threshold)
#define hyudoro_center_master(o) ((o)->target)
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;
}
static angle_t static angle_t
trace_angle (mobj_t *hyu) trace_angle (mobj_t *hyu)
{ {
mobj_t *center = hyu->target; mobj_t *center = hyu->target;
I_Assert(center != NULL && P_MobjWasRemoved(center) == false);
if (hyu->x != center->x || hyu->y != center->y) if (hyu->x != center->x || hyu->y != center->y)
{ {
return R_PointToAngle2( return R_PointToAngle2(
@ -100,15 +66,13 @@ get_look_angle (mobj_t *thing)
{ {
player_t *player = thing->player; player_t *player = thing->player;
I_Assert(player != NULL);
return player ? player->angleturn : thing->angle; return player ? player->angleturn : thing->angle;
} }
static boolean static boolean
is_hyudoro (mobj_t *thing) 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 * static mobj_t *
@ -116,8 +80,6 @@ get_hyudoro_master (mobj_t *hyu)
{ {
mobj_t *center = hyudoro_center(hyu); mobj_t *center = hyudoro_center(hyu);
I_Assert(center != NULL && P_MobjWasRemoved(center) == false);
return center ? hyudoro_center_master(center) : NULL; return center ? hyudoro_center_master(center) : NULL;
} }
@ -135,8 +97,6 @@ sine_bob
angle_t a, angle_t a,
fixed_t sineofs) fixed_t sineofs)
{ {
I_Assert(hyu != NULL && P_MobjWasRemoved(hyu) == false);
hyu->sprzoff = FixedMul(hyu->height, hyu->sprzoff = FixedMul(hyu->height,
sineofs + FINESINE(a >> ANGLETOFINESHIFT)); sineofs + FINESINE(a >> ANGLETOFINESHIFT));
} }
@ -220,7 +180,7 @@ move_to_player (mobj_t *hyu)
angle_t angle; angle_t angle;
if (target == NULL || P_MobjWasRemoved(target) == true) if (!target)
return; return;
angle = R_PointToAngle2( angle = R_PointToAngle2(