- use symbolic constants in neartag calls.

This commit is contained in:
Christoph Oelckers 2022-09-25 10:57:46 +02:00
parent 3f540c3201
commit 20043f6223
7 changed files with 21 additions and 15 deletions

View file

@ -288,6 +288,13 @@ void dragpoint(walltype* wal, const DVector2& pos);
int32_t inside(double x, double y, const sectortype* sect);
int insidePoly(double x, double y, const DVector2* points, int count);
enum {
NT_Lotag = 1,
NT_Hitag = 2,
NT_NoSpriteCheck = 4
};
//==========================================================================
//
// slope stuff (many wrappers, one worker only)

View file

@ -2482,7 +2482,7 @@ int ParseState::parse(void)
if( g_ac->sector()->lotag == 0 )
{
HitInfo hit{};
neartag(g_ac->spr.pos.plusZ(-32), g_ac->sector(), g_ac->spr.angle, hit, 48, 1);
neartag(g_ac->spr.pos.plusZ(-32), g_ac->sector(), g_ac->spr.angle, hit, 48, NT_Lotag | NT_NoSpriteCheck);
auto sectp = hit.hitSector;
if (sectp)
{

View file

@ -1595,17 +1595,17 @@ void checksectors_d(int snum)
return;
}
if (p->newOwner != nullptr)
neartag(p->opos, p->GetActor()->sector(), p->angle.oang, near, 80., 1);
neartag(p->opos, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
else
{
neartag(p->pos, p->GetActor()->sector(), p->angle.oang, near, 80., 1);
neartag(p->pos, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->pos.plusZ(8), p->GetActor()->sector(), p->angle.oang, near, 80., 1);
neartag(p->pos.plusZ(8), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->pos.plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., 1);
neartag(p->pos.plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
{
neartag(p->pos.plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., 3);
neartag(p->pos.plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag | NT_Hitag);
if (near.actor() != nullptr)
{
switch (near.actor()->spr.picnum)

View file

@ -2533,21 +2533,21 @@ void checksectors_r(int snum)
}
return;
}
neartag(p->pos, p->GetActor()->sector(), p->angle.oang, near , 80., 3);
neartag(p->pos, p->GetActor()->sector(), p->angle.oang, near , 80., NT_Lotag | NT_Hitag);
}
if (p->newOwner != nullptr)
neartag(p->opos, p->GetActor()->sector(), p->angle.oang, near, 80., 1);
neartag(p->opos, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
else
{
neartag(p->pos, p->GetActor()->sector(), p->angle.oang, near, 80., 1);
neartag(p->pos, p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->pos.plusZ(8), p->GetActor()->sector(), p->angle.oang, near, 80., 1);
neartag(p->pos.plusZ(8), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
neartag(p->pos.plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., 1);
neartag(p->pos.plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag);
if (near.actor() == nullptr && near.hitWall == nullptr && near.hitSector == nullptr)
{
neartag(p->pos.plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., 3);
neartag(p->pos.plusZ(16), p->GetActor()->sector(), p->angle.oang, near, 80., NT_Lotag | NT_Hitag);
if (near.actor() != nullptr)
{
switch (near.actor()->spr.picnum)

View file

@ -1364,7 +1364,7 @@ sectdone:
HitInfo near;
// neartag finds the nearest sector, wall, and sprite which has its hitag and/or lotag set to a value.
neartag(pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.angle, near, 128., 2);
neartag(pPlayerActor->spr.pos, pPlayerActor->sector(), pPlayerActor->spr.angle, near, 128., NT_Hitag | NT_NoSpriteCheck);
DExhumedActor* pActorB;
feebtag(pPlayerActor->spr.pos, pPlayerActor->sector(), &pActorB, var_30, 48);

View file

@ -2211,7 +2211,7 @@ bool NearThings(PLAYER* pp)
//
//---------------------------------------------------------------------------
short nti_cnt;
static int nti_cnt;
void NearTagList(NEAR_TAG_INFO* ntip, PLAYER* pp, double z, double dist, int type, int count)
{

View file

@ -62,7 +62,6 @@ struct NEAR_TAG_INFO
walltype* wallp;
DSWActor* actor;
};
extern short nti_cnt;
void DoSpawnSpotsForKill(short match);
void DoSpawnSpotsForDamage(short match);