mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- use symbolic constants in neartag calls.
This commit is contained in:
parent
3f540c3201
commit
20043f6223
7 changed files with 21 additions and 15 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -62,7 +62,6 @@ struct NEAR_TAG_INFO
|
|||
walltype* wallp;
|
||||
DSWActor* actor;
|
||||
};
|
||||
extern short nti_cnt;
|
||||
|
||||
void DoSpawnSpotsForKill(short match);
|
||||
void DoSpawnSpotsForDamage(short match);
|
||||
|
|
Loading…
Reference in a new issue