mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-21 11:11:16 +00:00
- eliminated the last uses of int_hitpos.
This commit is contained in:
parent
a655b3835f
commit
0ef9527209
2 changed files with 6 additions and 3 deletions
|
@ -864,7 +864,8 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
bool immune = nnExtIsImmune(hitactor, gVectorData[curWeapon].dmgType);
|
||||
if (!(hitactor->hasX() && (!immune || (immune && hitactor->spr.statnum == kStatThing && hitactor->xspr.Vector)) && !hitactor->xspr.locked))
|
||||
{
|
||||
if ((approxDist(gHitInfo.int_hitpos().X - actor->int_pos().X, gHitInfo.int_hitpos().Y - actor->int_pos().Y) <= 1500 && !blck)
|
||||
auto hdist = (gHitInfo.hitpos.XY() - actor->spr.pos.XY()).Length();
|
||||
if ((hdist <= 93.75 && !blck)
|
||||
|| (dist <= (int)(pExtra->fireDist / ClipLow(Random(4), 1))))
|
||||
{
|
||||
//viewSetSystemMessage("GO CHASE");
|
||||
|
|
|
@ -286,6 +286,8 @@ 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)
|
||||
{
|
||||
double zz = z * zinttoworld;
|
||||
|
||||
assert(actor != nullptr);
|
||||
assert(dx != 0 || dy != 0);
|
||||
gHitInfo.clearObj();
|
||||
|
@ -294,7 +296,7 @@ int HitScan(DBloodActor* actor, int z, int dx, int dy, int dz, unsigned int nMas
|
|||
DVector2 hitscangoal;
|
||||
if (nRange) hitscangoal = actor->spr.pos.XY() + actor->spr.angle.ToVector() * nRange;
|
||||
else hitscangoal.Zero();
|
||||
hitscan(DVector3(actor->spr.pos.XY(), z * zinttoworld), actor->sector(), DVector3(dx, dy, dz) * inttoworld, gHitInfo, nMask, & hitscangoal);
|
||||
hitscan(DVector3(actor->spr.pos.XY(), zz), actor->sector(), DVector3(dx, dy, dz) * inttoworld, gHitInfo, nMask, &hitscangoal);
|
||||
|
||||
actor->spr.cstat = bakCstat;
|
||||
if (gHitInfo.actor() != nullptr)
|
||||
|
@ -312,7 +314,7 @@ int HitScan(DBloodActor* actor, int z, int dx, int dy, int dz, unsigned int nMas
|
|||
return 4;
|
||||
}
|
||||
if (gHitInfo.hitSector != nullptr)
|
||||
return 1 + (z < gHitInfo.int_hitpos().Z);
|
||||
return 1 + (zz < gHitInfo.hitpos.Z);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue