mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- renamed HitScan to HitScan_ as a refactoring aid.
This commit is contained in:
parent
049ced83f6
commit
a4ec938526
17 changed files with 49 additions and 49 deletions
|
@ -6337,7 +6337,7 @@ DBloodActor* actFireThing(DBloodActor* actor, double xyoff, double zoff, double
|
|||
|
||||
DVector3 vect = actor->spr.pos.plusZ(zoff) + (actor->spr.angle + DAngle90).ToVector() * xyoff + actor->spr.angle.ToVector() * actor->fClipdist();
|
||||
|
||||
if (HitScan(actor, vect.Z, DVector3(vect.XY() - actor->spr.pos.XY(), 0), CLIPMASK0, actor->native_clipdist()) != -1)
|
||||
if (HitScan_(actor, vect.Z, DVector3(vect.XY() - actor->spr.pos.XY(), 0), CLIPMASK0, actor->native_clipdist()) != -1)
|
||||
{
|
||||
vect.XY() = gHitInfo.hitpos.XY() - actor->spr.angle.ToVector() * actor->fClipdist() * 2;
|
||||
}
|
||||
|
@ -6448,7 +6448,7 @@ DBloodActor* actFireMissile(DBloodActor* actor, double xyoff, double zoff, DVect
|
|||
double clipdist = pMissileInfo->fClipDist() + actor->fClipdist();
|
||||
vect += actor->spr.angle.ToVector() * clipdist;
|
||||
|
||||
int hit = HitScan(actor, vect.Z, DVector3(vect.XY() - actor->spr.pos.XY(), 0), CLIPMASK0, int(clipdist * 4));
|
||||
int hit = HitScan_(actor, vect.Z, DVector3(vect.XY() - actor->spr.pos.XY(), 0), CLIPMASK0, int(clipdist * 4));
|
||||
if (hit != -1)
|
||||
{
|
||||
if (hit == 3 || hit == 0)
|
||||
|
@ -6746,7 +6746,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3
|
|||
dv.X += FixedToFloat<14>(Random3(4000)); // random messiness...
|
||||
dv.Y += FixedToFloat<14>(Random3(4000));
|
||||
dv.Z += FixedToFloat<14>(Random3(4000));
|
||||
if (HitScan(actor, gHitInfo.hitpos.Z, dv, CLIPMASK1, tt) == 0)
|
||||
if (HitScan_(actor, gHitInfo.hitpos.Z, dv, CLIPMASK1, tt) == 0)
|
||||
{
|
||||
if ((gHitInfo.hitpos.XY() - actor->spr.pos.XY()).LengthSquared() <= tt * tt)
|
||||
{
|
||||
|
|
|
@ -134,7 +134,7 @@ bool CanMove(DBloodActor* actor, DBloodActor* target, int nAngle, int nRange)
|
|||
int x = actor->int_pos().X;
|
||||
int y = actor->int_pos().Y;
|
||||
int z = actor->int_pos().Z;
|
||||
HitScan(actor, z, bcos(nAngle), bsin(nAngle), 0, CLIPMASK0, nRange);
|
||||
HitScan_(actor, z, bcos(nAngle), bsin(nAngle), 0, CLIPMASK0, nRange);
|
||||
int nDist = approxDist(actor->spr.pos.XY() - gHitInfo.hitpos.XY());
|
||||
if (nDist - (actor->int_clipdist()) < nRange)
|
||||
{
|
||||
|
|
|
@ -90,7 +90,7 @@ void StompSeqCallback(int, DBloodActor* actor)
|
|||
|
||||
const bool newSectCheckMethod = !cl_bloodvanillaenemies && !VanillaMode(); // use new sector checking logic
|
||||
auto sectorMap = GetClosestSpriteSectors(pSector, actor->spr.pos.XY(), nDist, nullptr, newSectCheckMethod);
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector() * 1024, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(actor->spr.angle.ToVector() * 1024, 0), CLIPMASK1, 0);
|
||||
DBloodActor* actorh = nullptr;
|
||||
actHitcodeToData(hit, &gHitInfo, &actorh);
|
||||
|
||||
|
@ -243,7 +243,7 @@ static void beastThinkChase(DBloodActor* actor)
|
|||
if (nDist < 0x140 && nDist > 0xa0 && nDeltaAngle < DAngle15 && (target->spr.flags & 2)
|
||||
&& target->IsPlayerActor() && Chance(0x8000))
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dv, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dv, 0), CLIPMASK1, 0);
|
||||
if (target->xspr.health > (unsigned)gPlayerTemplate[0].startHealth / 2)
|
||||
{
|
||||
switch (hit)
|
||||
|
@ -275,7 +275,7 @@ static void beastThinkChase(DBloodActor* actor)
|
|||
}
|
||||
if (nDist < 57.5625 && abs(nDeltaAngle) < mapangle(28))
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dv, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dv, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
|
|
@ -164,7 +164,7 @@ static void calebThinkChase(DBloodActor* actor)
|
|||
{
|
||||
int dx = dvec.X * worldtoint;
|
||||
int dy = dvec.Y * worldtoint;
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
|
|
@ -389,7 +389,7 @@ static void cerberusThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (nDist < 0x20 && nDeltaAngle < DAngle15)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (actor->spr.type) {
|
||||
case kDudeCerberusTwoHead:
|
||||
switch (hit) {
|
||||
|
|
|
@ -284,7 +284,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
&& (target->spr.flags & 2) && gGameOptions.nDifficulty > 2 && target->IsPlayerActor() && gPlayer[target->spr.type - kDudePlayer1].isRunning
|
||||
&& Chance(0x8000))
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -305,7 +305,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (nDist < 0x460 && nDeltaAngle < DAngle1 * 5)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -352,7 +352,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
&& (target->spr.flags & 2) && gGameOptions.nDifficulty >= 2 && target->IsPlayerActor() && !gPlayer[target->spr.type - kDudePlayer1].isRunning
|
||||
&& Chance(0x8000))
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -373,7 +373,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (nDist < 0x320 && nDeltaAngle < DAngle1 * 5)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -420,7 +420,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
&& (target->spr.flags & 2) && gGameOptions.nDifficulty > 2 && target->IsPlayerActor() && gPlayer[target->spr.type - kDudePlayer1].isRunning
|
||||
&& Chance(0x8000))
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -442,7 +442,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
else if (nDist < 0x320 && nDeltaAngle < DAngle1 * 5)
|
||||
{
|
||||
AISTATE *pCultistTsProneFire = !cl_bloodvanillaenemies && !VanillaMode() ? &cultistTsProneFireFixed : &cultistTsProneFire;
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -487,7 +487,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
case kDudeCultistTNT:
|
||||
if (nDist < 0x2c0 && nDist > 0x140 && nDeltaAngle < DAngle15 && (target->spr.flags & 2) && target->IsPlayerActor())
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -507,7 +507,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (nDist < 0x140 && nDeltaAngle < DAngle15 && (target->spr.flags & 2) && target->IsPlayerActor())
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -531,7 +531,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
&& (target->spr.flags & 2) && gGameOptions.nDifficulty > 2 && target->IsPlayerActor() && gPlayer[target->spr.type - kDudePlayer1].isRunning
|
||||
&& Chance(0x8000))
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -552,7 +552,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (nDist < 0x320 && abs(nDeltaAngle) < DAngle1 * 5)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, DVector3(dvec, 0), CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
|
|
@ -362,7 +362,7 @@ static void gargThinkChase(DBloodActor* actor)
|
|||
case kDudeGargoyleFlesh:
|
||||
if (nDist < 0x180 && nDist > 0xc0 && angWithinRange)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -387,7 +387,7 @@ static void gargThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (nDist < 0x40 && angWithinRange)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -421,7 +421,7 @@ static void gargThinkChase(DBloodActor* actor)
|
|||
case kDudeGargoyleStone:
|
||||
if (nDist < 0x180 && nDist > 0xc0 && angWithinRange)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -446,7 +446,7 @@ static void gargThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (nDist < 0x40 && angWithinRange)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
|
|
@ -338,7 +338,7 @@ static void ghostThinkChase(DBloodActor* actor)
|
|||
switch (actor->spr.type) {
|
||||
case kDudePhantasm:
|
||||
if (nDist < 0x200 && nDist > 0x100 && angWithinRange) {
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -358,7 +358,7 @@ static void ghostThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (nDist < 0x40 && angWithinRange)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dxy.X * worldtoint, dxy.Y * worldtoint, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
|
|
@ -148,7 +148,7 @@ static void gillThinkChase(DBloodActor* actor)
|
|||
actor->dudeSlope = nDist == 0 ? 0 : DivScale(target->int_pos().Z - actor->int_pos().Z, nDist, 10);
|
||||
if (nDist < 921 && abs(nDeltaAngle) < 28)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
|
|
@ -70,7 +70,7 @@ void SpidBiteSeqCallback(int, DBloodActor* actor)
|
|||
auto const target = actor->GetTarget();
|
||||
if (target->IsPlayerActor())
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
if (hit == 3 && gHitInfo.actor()->IsPlayerActor())
|
||||
{
|
||||
dz += target->int_pos().Z - actor->int_pos().Z;
|
||||
|
|
|
@ -139,7 +139,7 @@ static bool genDudeAdjustSlope(DBloodActor* actor, int dist, int weaponType, int
|
|||
|
||||
for (int i = -8191; i < 8192; i += by)
|
||||
{
|
||||
HitScan(actor, actor->spr.pos.Z, bcos(actor->int_ang()), bsin(actor->int_ang()), i, clipMask, dist);
|
||||
HitScan_(actor, actor->spr.pos.Z, bcos(actor->int_ang()), bsin(actor->int_ang()), i, clipMask, dist);
|
||||
if (!fStart && actor->GetTarget() == gHitInfo.actor()) fStart = i;
|
||||
else if (fStart && actor->GetTarget() != gHitInfo.actor())
|
||||
{
|
||||
|
@ -554,7 +554,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (dist < 12264 && dist > 7680 && !spriteIsUnderwater(actor, false) && curWeapon != kModernThingEnemyLifeLeech)
|
||||
{
|
||||
int pHit = HitScan(actor, actor->spr.pos.Z, dx, dy, 0, 16777280, 0);
|
||||
int pHit = HitScan_(actor, actor->spr.pos.Z, dx, dy, 0, 16777280, 0);
|
||||
switch (pHit) {
|
||||
case 0:
|
||||
case 4:
|
||||
|
@ -743,9 +743,9 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
{
|
||||
int objDist = -1; int targetDist = -1; int hit = -1;
|
||||
if (weaponType == kGenDudeWeaponHitscan)
|
||||
hit = HitScan(actor, actor->spr.pos.Z, bcos(actor->int_ang()), bsin(actor->int_ang()), actor->dudeSlope, CLIPMASK1, dist);
|
||||
hit = HitScan_(actor, actor->spr.pos.Z, bcos(actor->int_ang()), bsin(actor->int_ang()), actor->dudeSlope, CLIPMASK1, dist);
|
||||
else if (weaponType == kGenDudeWeaponMissile)
|
||||
hit = HitScan(actor, actor->spr.pos.Z, bcos(actor->int_ang()), bsin(actor->int_ang()), actor->dudeSlope, CLIPMASK0, dist);
|
||||
hit = HitScan_(actor, actor->spr.pos.Z, bcos(actor->int_ang()), bsin(actor->int_ang()), actor->dudeSlope, CLIPMASK0, dist);
|
||||
|
||||
if (hit >= 0)
|
||||
{
|
||||
|
|
|
@ -136,7 +136,7 @@ static void zombfThinkChase(DBloodActor* actor)
|
|||
aiSetTarget(actor, actor->GetTarget());
|
||||
if (nDist < 0x1400 && nDist > 0xe00 && abs(nDeltaAngle) < 85)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -155,7 +155,7 @@ static void zombfThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (nDist < 0x1400 && nDist > 0x600 && abs(nDeltaAngle) < 85)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
@ -174,7 +174,7 @@ static void zombfThinkChase(DBloodActor* actor)
|
|||
}
|
||||
else if (nDist < 0x400 && abs(nDeltaAngle) < 85)
|
||||
{
|
||||
int hit = HitScan(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
int hit = HitScan_(actor, actor->spr.pos.Z, dx, dy, 0, CLIPMASK1, 0);
|
||||
switch (hit)
|
||||
{
|
||||
case -1:
|
||||
|
|
|
@ -284,7 +284,7 @@ bool IntersectRay(int wx, int wy, int wdx, int wdy, int x1, int y1, int z1, int
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int HitScan(DBloodActor* actor, int z, int dx, int dy, int dz, unsigned int nMask, int nRange)
|
||||
int HitScan_(DBloodActor* actor, int z, int dx, int dy, int dz, unsigned int nMask, int nRange)
|
||||
{
|
||||
double zz = z * zinttoworld;
|
||||
|
||||
|
|
|
@ -36,14 +36,14 @@ bool CheckProximity(DBloodActor* pSprite, const DVector3& pos, sectortype* pSect
|
|||
bool CheckProximityPoint(int nX1, int nY1, int nZ1, int nX2, int nY2, int nZ2, int nDist);
|
||||
[[deprecated]] int GetWallAngle(walltype* pWall);
|
||||
bool IntersectRay(int wx, int wy, int wdx, int wdy, int x1, int y1, int z1, int x2, int y2, int z2, int* ix, int* iy, int* iz);
|
||||
int HitScan(DBloodActor* pSprite, int z, int dx, int dy, int dz, unsigned int nMask, int a8);
|
||||
inline int HitScan(DBloodActor* pSprite, double z, int dx, int dy, int dz, unsigned int nMask, int a8)
|
||||
int HitScan_(DBloodActor* pSprite, int z, int dx, int dy, int dz, unsigned int nMask, int a8);
|
||||
inline int HitScan_(DBloodActor* pSprite, double z, int dx, int dy, int dz, unsigned int nMask, int a8)
|
||||
{
|
||||
return HitScan(pSprite, int(z * zworldtoint), dx, dy, dz, nMask, a8);
|
||||
return HitScan_(pSprite, int(z * zworldtoint), dx, dy, dz, nMask, a8);
|
||||
}
|
||||
inline int HitScan(DBloodActor* pSprite, double z, const DVector3& pos, unsigned int nMask, int a8)
|
||||
inline int HitScan_(DBloodActor* pSprite, double z, const DVector3& pos, unsigned int nMask, int a8)
|
||||
{
|
||||
return HitScan(pSprite, int(z * zworldtoint), int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * worldtoint), nMask, a8);
|
||||
return HitScan_(pSprite, int(z * zworldtoint), int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint), nMask, a8);
|
||||
}
|
||||
int VectorScan(DBloodActor* pSprite, double nOffset, double nZOffset, const DVector3& vel, double nRange, int ac);
|
||||
|
||||
|
|
|
@ -1250,7 +1250,7 @@ void nnExtProcessSuperSprites()
|
|||
if (!vector)
|
||||
pSight->spr.cstat |= CSTAT_SPRITE_BLOCK_HITSCAN;
|
||||
|
||||
HitScan(pPlayer->actor, pPlayer->zWeapon, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, CLIPMASK0 | CLIPMASK1, 0);
|
||||
HitScan_(pPlayer->actor, pPlayer->zWeapon, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, CLIPMASK0 | CLIPMASK1, 0);
|
||||
|
||||
if (!vector)
|
||||
pSight->spr.cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN;
|
||||
|
@ -4644,17 +4644,17 @@ bool condCheckSprite(DBloodActor* aCond, int cmpOp, bool PUSH)
|
|||
}
|
||||
|
||||
if ((pPlayer = getPlayerById(objActor->spr.type)) != NULL)
|
||||
var = HitScan(objActor, pPlayer->zWeapon, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, arg1, arg3 << 1);
|
||||
var = HitScan_(objActor, pPlayer->zWeapon, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, arg1, arg3 << 1);
|
||||
else if (objActor->IsDudeActor())
|
||||
var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector() * 1024, (!objActor->hasX()) ? 0 : objActor->dudeSlope * inttoworld), arg1, arg3 << 1);
|
||||
var = HitScan_(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector() * 1024, (!objActor->hasX()) ? 0 : objActor->dudeSlope * inttoworld), arg1, arg3 << 1);
|
||||
else if ((objActor->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == CSTAT_SPRITE_ALIGNMENT_FLOOR)
|
||||
{
|
||||
var3 = (objActor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 8192 : -8192; // was 0x20000 - HitScan uses Q28.4 for dz!
|
||||
var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector() * 1024, var3), arg1, arg3 << 1);
|
||||
var3 = (objActor->spr.cstat & CSTAT_SPRITE_YFLIP) ? 8192 : -8192; // was 0x20000 - HitScan_ uses Q28.4 for dz!
|
||||
var = HitScan_(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector() * 1024, var3), arg1, arg3 << 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
var = HitScan(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector() * 1024, 0), arg1, arg3 << 1);
|
||||
var = HitScan_(objActor, objActor->spr.pos.Z, DVector3(objActor->spr.angle.ToVector() * 1024, 0), arg1, arg3 << 1);
|
||||
}
|
||||
|
||||
if (var < 0)
|
||||
|
@ -7691,7 +7691,7 @@ bool nnExtCanMove(DBloodActor* actor, DBloodActor* target, DAngle nAngle, int nR
|
|||
DVector2 nAngVect = nAngle.ToVector();
|
||||
|
||||
auto pSector = actor->sector();
|
||||
HitScan(actor, pos.Z * zworldtoint, nAngVect.X * (1 << 14), nAngVect.Y * (1 << 14), 0, CLIPMASK0, 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)
|
||||
|
|
|
@ -1420,7 +1420,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
|
|||
auto plActor = pPlayer->actor;
|
||||
*out = {};
|
||||
auto pos = DVector3(plActor->spr.angle.ToVector() * 1024., pPlayer->slope * inttoworld);
|
||||
int hit = HitScan(pPlayer->actor, pPlayer->zView, pos, 0x10000040, 128);
|
||||
int hit = HitScan_(pPlayer->actor, pPlayer->zView, pos, 0x10000040, 128);
|
||||
double hitDist = (plActor->spr.pos.XY() - gHitInfo.hitpos.XY()).Length();
|
||||
if (hitDist < 64)
|
||||
{
|
||||
|
|
|
@ -116,7 +116,7 @@ void viewDrawAimedPlayerName(PLAYER* pPlayer)
|
|||
if (!cl_idplayers || (pPlayer->aim.dx == 0 && pPlayer->aim.dy == 0))
|
||||
return;
|
||||
|
||||
int hit = HitScan(pPlayer->actor, pPlayer->zView, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, CLIPMASK0, 512);
|
||||
int hit = HitScan_(pPlayer->actor, pPlayer->zView, pPlayer->aim.dx, pPlayer->aim.dy, pPlayer->aim.dz, CLIPMASK0, 512);
|
||||
if (hit == 3)
|
||||
{
|
||||
auto actor = gHitInfo.actor();
|
||||
|
|
Loading…
Reference in a new issue