- migrated all of SW's neartag calls to the fully floatified version

This commit is contained in:
Christoph Oelckers 2022-09-25 10:57:46 +02:00
parent 20043f6223
commit aae468e2b2
5 changed files with 10 additions and 14 deletions

View file

@ -432,7 +432,7 @@ int DoActorOperate(DSWActor* actor)
for (i = 0; i < SIZ(z); i++)
{
neartag(actor->spr.pos.plusZ(z[i]), actor->sector(), actor->spr.angle, near, 1024, NTAG_SEARCH_LO_HI);
neartag(actor->spr.pos.plusZ(z[i]), actor->sector(), actor->spr.angle, near, 64., NT_Lotag | NT_Hitag | NT_NoSpriteCheck);
}
if (near.hitSector != nullptr && near.hitpos.X < 64)

View file

@ -1720,10 +1720,6 @@ enum
STAT_DAMAGE_LIST_SIZE = 20,
COLOR_PAIN = 128, // Light red range
NTAG_SEARCH_LO = 1,
NTAG_SEARCH_HI = 2,
NTAG_SEARCH_LO_HI = 3,
ANIM_SERP = 1,
ANIM_SUMO =2,
ANIM_ZILLA =3

View file

@ -3510,7 +3510,7 @@ void DoPlayerClimb(PLAYER* pp)
HitInfo near;
// constantly look for new ladder sector because of warping at any time
neartag(pp->pos, pp->cursector, pp->angle.ang, near, 800, NTAG_SEARCH_LO_HI);
neartag(pp->pos, pp->cursector, pp->angle.ang, near, 50., NT_Lotag | NT_Hitag | NT_NoSpriteCheck);
if (near.hitWall)
{
@ -3871,7 +3871,7 @@ bool PlayerOnLadder(PLAYER* pp)
if (Prediction)
return false;
neartag(pp->pos, pp->cursector, pp->angle.ang, near, 1024 + 768, NTAG_SEARCH_LO_HI);
neartag(pp->pos, pp->cursector, pp->angle.ang, near, 64. + 48., NT_Lotag | NT_Hitag);
double dir = pp->vect.dot(pp->angle.ang.ToVector());
@ -3883,7 +3883,7 @@ bool PlayerOnLadder(PLAYER* pp)
for (i = 0; i < SIZ(angles); i++)
{
neartag(pp->pos, pp->cursector, pp->angle.ang + angles[i], near, 600, NTAG_SEARCH_LO_HI);
neartag(pp->pos, pp->cursector, pp->angle.ang + angles[i], near, 37.5, NT_Lotag | NT_Hitag | NT_NoSpriteCheck);
if (near.hitWall == nullptr || near.hitpos.X < 6.25 || near.hitWall->lotag != TAG_WALL_CLIMB)
return false;

View file

@ -2138,7 +2138,7 @@ bool NearThings(PLAYER* pp)
return false;
}
neartag(pp->pos, pp->cursector, pp->angle.ang, near, 1024, NTAG_SEARCH_LO_HI);
neartag(pp->pos, pp->cursector, pp->angle.ang, near, 64., NT_Lotag | NT_Hitag);
// hit a sprite? Check to see if it has sound info in it!
@ -2321,7 +2321,7 @@ void NearTagList(NEAR_TAG_INFO* ntip, PLAYER* pp, double z, double dist, int typ
//
//---------------------------------------------------------------------------
void BuildNearTagList(NEAR_TAG_INFO* ntip, int size, PLAYER* pp, double z, int dist, int type, int count)
void BuildNearTagList(NEAR_TAG_INFO* ntip, int size, PLAYER* pp, double z, double dist, int type, int count)
{
memset(ntip, -1, size);
nti_cnt = 0;
@ -2402,7 +2402,7 @@ void PlayerOperateEnv(PLAYER* pp)
NearThings(pp); // Check for player sound specified in a level sprite
}
BuildNearTagList(nti, sizeof(nti), pp, pp->pos.Z, 128, NTAG_SEARCH_LO_HI, 8);
BuildNearTagList(nti, sizeof(nti), pp, pp->pos.Z, 128, NT_Lotag | NT_Hitag, 8);
found = false;
@ -2431,7 +2431,7 @@ void PlayerOperateEnv(PLAYER* pp)
for (unsigned i = 0; i < SIZ(z); i++)
{
BuildNearTagList(nti, sizeof(nti), pp, z[i], 64 + 48, NTAG_SEARCH_LO_HI, 8);
BuildNearTagList(nti, sizeof(nti), pp, z[i], 64 + 48, NT_Lotag | NT_Hitag, 8);
for (nt_ndx = 0; nti[nt_ndx].Dist >= 0; nt_ndx++)
{

View file

@ -3039,7 +3039,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
for (auto& zz : z)
{
neartag(DVector3(actor->spr.pos.XY(), zz), actor->sector(), actor->spr.angle, near, 1024, NTAG_SEARCH_LO_HI);
neartag(DVector3(actor->spr.pos.XY(), zz), actor->sector(), actor->spr.angle, near, 64., NT_Lotag | NT_Hitag);
if (near.actor() != nullptr && near.hitpos.X < 64)
{
@ -3254,7 +3254,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
//
double z = ActorZOfTop(actor) - (ActorSizeZ(actor) * 0.5);
neartag(DVector3(actor->spr.pos.XY(), z), actor->sector(), actor->spr.angle, near, 600, NTAG_SEARCH_LO_HI);
neartag(DVector3(actor->spr.pos.XY(), z), actor->sector(), actor->spr.angle, near, 37.5, NT_Lotag | NT_Hitag | NT_NoSpriteCheck);
if (near.hitWall == nullptr)
{