mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- floatified nnextCanMove and deleted most deprecated updatesector variants.
This commit is contained in:
parent
c5a5e3cef5
commit
2e4996e8fc
2 changed files with 11 additions and 29 deletions
|
@ -124,26 +124,6 @@ inline void updatesector(int x_, int y_, int* sectnum)
|
|||
DoUpdateSector(x, y, 0, sectnum, MAXUPDATESECTORDIST, inside0);
|
||||
}
|
||||
|
||||
[[deprecated]]
|
||||
inline void updatesectorz(int x_, int y_, int z_, int* sectnum)
|
||||
{
|
||||
double x = x_ * inttoworld;
|
||||
double y = y_ * inttoworld;
|
||||
double z = z_ * zinttoworld;
|
||||
|
||||
DoUpdateSector(x, y, z, sectnum, MAXUPDATESECTORDIST, insideZ);
|
||||
}
|
||||
|
||||
[[deprecated]]
|
||||
inline void updatesector(int const x_, int const y_, sectortype** const sectp)
|
||||
{
|
||||
double x = x_ * inttoworld;
|
||||
double y = y_ * inttoworld;
|
||||
int sectno = *sectp ? sector.IndexOf(*sectp) : -1;
|
||||
DoUpdateSector(x, y, 0, §no, MAXUPDATESECTORDIST, inside0);
|
||||
*sectp = sectno == -1 ? nullptr : §or[sectno];
|
||||
}
|
||||
|
||||
[[deprecated]]
|
||||
inline void updatesectorz(int x_, int y_, int z_, sectortype** const sectp)
|
||||
{
|
||||
|
|
|
@ -7691,19 +7691,21 @@ bool setDataValueOfObject(int objType, sectortype* sect, walltype* wal, DBloodAc
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
bool nnExtCanMove(DBloodActor* actor, DBloodActor* target, DAngle nAngle_, int nRange)
|
||||
bool nnExtCanMove(DBloodActor* actor, DBloodActor* target, DAngle nAngle, int nRange_)
|
||||
{
|
||||
int nAngle = nAngle_.Buildang();
|
||||
int x = actor->int_pos().X, y = actor->int_pos().Y, z = actor->int_pos().Z;
|
||||
double nRange = nRange_ * inttoworld;
|
||||
DVector3 pos = actor->spr.pos;
|
||||
DVector2 nAngVect = nAngle.ToVector();
|
||||
|
||||
auto pSector = actor->sector();
|
||||
HitScan(actor, z, Cos(nAngle) >> 16, Sin(nAngle) >> 16, 0, CLIPMASK0, nRange);
|
||||
int nDist = approxDist(actor->spr.pos.XY() - gHitInfo.hitpos.XY());
|
||||
if (target != nullptr && nDist - (actor->int_clipdist()) < nRange)
|
||||
HitScan(actor, pos.Z * zworldtoint, nAngVect.X * (1 << 14), nAngVect.Y * (1 << 14), 0, CLIPMASK0, nRange);
|
||||
double nDist = (actor->spr.pos.XY() - gHitInfo.hitpos.XY()).Length();
|
||||
|
||||
if (target != nullptr && nDist - actor->fClipdist() < nRange)
|
||||
return (target == gHitInfo.actor());
|
||||
|
||||
x += MulScale(nRange, Cos(nAngle), 30);
|
||||
y += MulScale(nRange, Sin(nAngle), 30);
|
||||
updatesectorz(x, y, z, &pSector);
|
||||
pos += nAngVect * nRange;
|
||||
updatesectorz(pos, &pSector);
|
||||
if (!pSector) return false;
|
||||
|
||||
if (pSector->hasX()) {
|
||||
|
|
Loading…
Reference in a new issue