- use int_hitpos() access function where applicable

This commit is contained in:
Christoph Oelckers 2022-08-17 00:59:32 +02:00
parent 296b5d7edd
commit 55ade2eda4
28 changed files with 247 additions and 231 deletions

View file

@ -1329,7 +1329,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, sectortype* sec, HitInfoBase
} }
} }
if ((x1 != INT32_MAX) && (abs(x1-sv->X)+abs(y1-sv->Y) < abs((hit->__int_hitpos.X)-sv->X)+abs((hit->__int_hitpos.Y)-sv->Y))) if ((x1 != INT32_MAX) && (abs(x1-sv->X)+abs(y1-sv->Y) < abs((hit->int_hitpos().X)-sv->X)+abs((hit->int_hitpos().Y)-sv->Y)))
{ {
if (inside(x1,y1,sec) == 1) if (inside(x1,y1,sec) == 1)
{ {
@ -1386,7 +1386,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire
< compat_maybe_truncate_to_int32((coord_t)(x2-sv->X)*(y1-sv->Y))) continue; < compat_maybe_truncate_to_int32((coord_t)(x2-sv->X)*(y1-sv->Y))) continue;
if (rintersect(sv->X,sv->Y,sv->Z, vx,vy,vz, x1,y1, x2,y2, &intx,&inty,&intz) == -1) continue; if (rintersect(sv->X,sv->Y,sv->Z, vx,vy,vz, x1,y1, x2,y2, &intx,&inty,&intz) == -1) continue;
if (abs(intx-sv->X)+abs(inty-sv->Y) >= abs((hitinfo.__int_hitpos.X)-sv->X)+abs((hitinfo.__int_hitpos.Y)-sv->Y)) if (abs(intx-sv->X)+abs(inty-sv->Y) >= abs((hitinfo.int_hitpos().X)-sv->X)+abs((hitinfo.int_hitpos().Y)-sv->Y))
continue; continue;
if ((!wal->twoSided()) || (wal->cstat & EWallFlags::FromInt(dawalclipmask))) if ((!wal->twoSided()) || (wal->cstat & EWallFlags::FromInt(dawalclipmask)))
@ -1454,7 +1454,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire
ucoefup16 = rintersect(sv->X,sv->Y,sv->Z,vx,vy,vz,x1,y1,x2,y2,&intx,&inty,&intz); ucoefup16 = rintersect(sv->X,sv->Y,sv->Z,vx,vy,vz,x1,y1,x2,y2,&intx,&inty,&intz);
if (ucoefup16 == -1) continue; if (ucoefup16 == -1) continue;
if (abs(intx-sv->X)+abs(inty-sv->Y) > abs((hitinfo.__int_hitpos.X)-sv->X)+abs((hitinfo.__int_hitpos.Y)-sv->Y)) if (abs(intx-sv->X)+abs(inty-sv->Y) > abs((hitinfo.int_hitpos().X)-sv->X)+abs((hitinfo.int_hitpos().Y)-sv->Y))
continue; continue;
daz = actor->int_pos().Z + actor->GetOffsetAndHeight(k); daz = actor->int_pos().Z + actor->GetOffsetAndHeight(k);
@ -1496,7 +1496,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire
intx = int(sv->X + (int64_t(intz) - sv->Z) * vx / vz); intx = int(sv->X + (int64_t(intz) - sv->Z) * vx / vz);
inty = int(sv->Y + (int64_t(intz) - sv->Z) * vy / vz); inty = int(sv->Y + (int64_t(intz) - sv->Z) * vy / vz);
if (abs(intx-sv->X)+abs(inty-sv->Y) > abs((hitinfo.__int_hitpos.X)-sv->X)+abs((hitinfo.__int_hitpos.Y)-sv->Y)) if (abs(intx-sv->X)+abs(inty-sv->Y) > abs((hitinfo.int_hitpos().X)-sv->X)+abs((hitinfo.int_hitpos().Y)-sv->Y))
continue; continue;
get_floorspr_points(actor, intx, inty, &x1, &x2, &x3, &x4, get_floorspr_points(actor, intx, inty, &x1, &x2, &x3, &x4,
@ -1526,7 +1526,7 @@ int hitscan(const vec3_t& start, const sectortype* startsect, const vec3_t& dire
inty = sv->Y + MulScale(vy, dist2, 30); inty = sv->Y + MulScale(vy, dist2, 30);
intz = sv->Z + MulScale(vz, dist2, 30); intz = sv->Z + MulScale(vz, dist2, 30);
if (abs(intx - sv->X) + abs(inty - sv->Y) > abs((hitinfo.__int_hitpos.X) - sv->X) + abs((hitinfo.__int_hitpos.Y) - sv->Y)) if (abs(intx - sv->X) + abs(inty - sv->Y) > abs((hitinfo.int_hitpos().X) - sv->X) + abs((hitinfo.int_hitpos().Y) - sv->Y))
continue; continue;
get_floorspr_points(actor, intx, inty, &x1, &x2, &x3, &x4, get_floorspr_points(actor, intx, inty, &x1, &x2, &x3, &x4,

View file

@ -300,6 +300,11 @@ struct HitInfoBase
hitWall = nullptr; hitWall = nullptr;
hitActor = nullptr; hitActor = nullptr;
} }
const vec3_t int_hitpos() const
{
return __int_hitpos;
}
}; };
template<class T> template<class T>

View file

@ -52,8 +52,8 @@ bool calcChaseCamPos(int* px, int* py, int* pz, DCoreActor* act, sectortype** ps
hitscan({ *px, *py, *pz }, *psect, np, hitinfo, CLIPMASK1); hitscan({ *px, *py, *pz }, *psect, np, hitinfo, CLIPMASK1);
act->spr.cstat = bakcstat; act->spr.cstat = bakcstat;
int hx = hitinfo.__int_hitpos.X - *px; int hx = hitinfo.int_hitpos().X - *px;
int hy = hitinfo.__int_hitpos.Y - *py; int hy = hitinfo.int_hitpos().Y - *py;
if (*psect == nullptr) if (*psect == nullptr)
{ {

View file

@ -6410,8 +6410,8 @@ DBloodActor* actFireThing(DBloodActor* actor, int a2, int a3, int a4, int thingT
y += MulScale(actor->spr.clipdist, Sin(actor->int_ang()), 28); y += MulScale(actor->spr.clipdist, Sin(actor->int_ang()), 28);
if (HitScan(actor, z, x - actor->int_pos().X, y - actor->int_pos().Y, 0, CLIPMASK0, actor->spr.clipdist) != -1) if (HitScan(actor, z, x - actor->int_pos().X, y - actor->int_pos().Y, 0, CLIPMASK0, actor->spr.clipdist) != -1)
{ {
x = gHitInfo.__int_hitpos.X - MulScale(actor->spr.clipdist << 1, Cos(actor->int_ang()), 28); x = gHitInfo.int_hitpos().X - MulScale(actor->spr.clipdist << 1, Cos(actor->int_ang()), 28);
y = gHitInfo.__int_hitpos.Y - MulScale(actor->spr.clipdist << 1, Sin(actor->int_ang()), 28); y = gHitInfo.int_hitpos().Y - MulScale(actor->spr.clipdist << 1, Sin(actor->int_ang()), 28);
} }
auto fired = actSpawnThing(actor->sector(), x, y, z, thingType); auto fired = actSpawnThing(actor->sector(), x, y, z, thingType);
fired->SetOwner(actor); fired->SetOwner(actor);
@ -6527,13 +6527,13 @@ DBloodActor* actFireMissile(DBloodActor* actor, int a2, int a3, int a4, int a5,
if (hit == 3 || hit == 0) if (hit == 3 || hit == 0)
{ {
impact = true; impact = true;
x = gHitInfo.__int_hitpos.X - MulScale(Cos(actor->int_ang()), 16, 30); x = gHitInfo.int_hitpos().X - MulScale(Cos(actor->int_ang()), 16, 30);
y = gHitInfo.__int_hitpos.Y - MulScale(Sin(actor->int_ang()), 16, 30); y = gHitInfo.int_hitpos().Y - MulScale(Sin(actor->int_ang()), 16, 30);
} }
else else
{ {
x = gHitInfo.__int_hitpos.X - MulScale(pMissileInfo->clipDist << 1, Cos(actor->int_ang()), 28); x = gHitInfo.int_hitpos().X - MulScale(pMissileInfo->clipDist << 1, Cos(actor->int_ang()), 28);
y = gHitInfo.__int_hitpos.Y - MulScale(pMissileInfo->clipDist << 1, Sin(actor->int_ang()), 28); y = gHitInfo.int_hitpos().Y - MulScale(pMissileInfo->clipDist << 1, Sin(actor->int_ang()), 28);
} }
} }
auto spawned = actSpawnSprite(actor->sector(), x, y, z, 5, 1); auto spawned = actSpawnSprite(actor->sector(), x, y, z, 5, 1);
@ -6706,12 +6706,12 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
} }
} }
} }
int x = gHitInfo.__int_hitpos.X - MulScale(a4, 16, 14); int x = gHitInfo.int_hitpos().X - MulScale(a4, 16, 14);
int y = gHitInfo.__int_hitpos.Y - MulScale(a5, 16, 14); int y = gHitInfo.int_hitpos().Y - MulScale(a5, 16, 14);
int z = gHitInfo.__int_hitpos.Z - MulScale(a6, 256, 14); int z = gHitInfo.int_hitpos().Z - MulScale(a6, 256, 14);
auto pSector = gHitInfo.hitSector; auto pSector = gHitInfo.hitSector;
uint8_t nSurf = kSurfNone; uint8_t nSurf = kSurfNone;
if (nRange == 0 || approxDist(gHitInfo.__int_hitpos.X - shooter->int_pos().X, gHitInfo.__int_hitpos.Y - shooter->int_pos().Y) < nRange) if (nRange == 0 || approxDist(gHitInfo.int_hitpos().X - shooter->int_pos().X, gHitInfo.int_hitpos().Y - shooter->int_pos().Y) < nRange)
{ {
switch (hit) switch (hit)
{ {
@ -6737,9 +6737,9 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
nSurf = surfType[pWall->picnum]; nSurf = surfType[pWall->picnum];
if (actCanSplatWall(pWall)) if (actCanSplatWall(pWall))
{ {
int xx = gHitInfo.__int_hitpos.X - MulScale(a4, 16, 14); int xx = gHitInfo.int_hitpos().X - MulScale(a4, 16, 14);
int yy = gHitInfo.__int_hitpos.Y - MulScale(a5, 16, 14); int yy = gHitInfo.int_hitpos().Y - MulScale(a5, 16, 14);
int zz = gHitInfo.__int_hitpos.Z - MulScale(a6, 256, 14); int zz = gHitInfo.int_hitpos().Z - MulScale(a6, 256, 14);
int nnSurf = surfType[pWall->picnum]; int nnSurf = surfType[pWall->picnum];
assert(nnSurf < kSurfMax); assert(nnSurf < kSurfMax);
if (pVectorData->surfHit[nnSurf].fx1 >= 0) if (pVectorData->surfHit[nnSurf].fx1 >= 0)
@ -6829,17 +6829,17 @@ void actFireVector(DBloodActor* shooter, int a2, int a3, int a4, int a5, int a6,
a4 += Random3(4000); a4 += Random3(4000);
a5 += Random3(4000); a5 += Random3(4000);
a6 += Random3(4000); a6 += Random3(4000);
if (HitScan(actor, gHitInfo.__int_hitpos.Z, a4, a5, a6, CLIPMASK1, tt) == 0) if (HitScan(actor, gHitInfo.int_hitpos().Z, a4, a5, a6, CLIPMASK1, tt) == 0)
{ {
if (approxDist(gHitInfo.__int_hitpos.X - actor->int_pos().X, gHitInfo.__int_hitpos.Y - actor->int_pos().Y) <= tt) if (approxDist(gHitInfo.int_hitpos().X - actor->int_pos().X, gHitInfo.int_hitpos().Y - actor->int_pos().Y) <= tt)
{ {
auto pWall = gHitInfo.hitWall; auto pWall = gHitInfo.hitWall;
auto pSector1 = gHitInfo.hitSector; auto pSector1 = gHitInfo.hitSector;
if (actCanSplatWall(pWall)) if (actCanSplatWall(pWall))
{ {
int xx = gHitInfo.__int_hitpos.X - MulScale(a4, 16, 14); int xx = gHitInfo.int_hitpos().X - MulScale(a4, 16, 14);
int yy = gHitInfo.__int_hitpos.Y - MulScale(a5, 16, 14); int yy = gHitInfo.int_hitpos().Y - MulScale(a5, 16, 14);
int zz = gHitInfo.__int_hitpos.Z - MulScale(a6, 16 << 4, 14); int zz = gHitInfo.int_hitpos().Z - MulScale(a6, 16 << 4, 14);
int nnSurf = surfType[pWall->picnum]; int nnSurf = surfType[pWall->picnum];
const VECTORDATA* pVectorData1 = &gVectorData[19]; const VECTORDATA* pVectorData1 = &gVectorData[19];
FX_ID t2 = pVectorData1->surfHit[nnSurf].fx2; FX_ID t2 = pVectorData1->surfHit[nnSurf].fx2;

View file

@ -135,7 +135,7 @@ bool CanMove(DBloodActor* actor, DBloodActor* target, int nAngle, int nRange)
int y = actor->int_pos().Y; int y = actor->int_pos().Y;
int z = actor->int_pos().Z; 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(x - gHitInfo.__int_hitpos.X, y - gHitInfo.__int_hitpos.Y); int nDist = approxDist(x - gHitInfo.int_hitpos().X, y - gHitInfo.int_hitpos().Y);
if (nDist - (actor->spr.clipdist << 2) < nRange) if (nDist - (actor->spr.clipdist << 2) < nRange)
{ {
if (gHitInfo.actor() == nullptr || target == nullptr || target != gHitInfo.actor()) if (gHitInfo.actor() == nullptr || target == nullptr || target != gHitInfo.actor())

View file

@ -751,7 +751,7 @@ static void unicultThinkChase(DBloodActor* actor)
if (hit >= 0) if (hit >= 0)
{ {
targetDist = dist - (target->spr.clipdist << 2); targetDist = dist - (target->spr.clipdist << 2);
objDist = approxDist(gHitInfo.__int_hitpos.X - actor->int_pos().X, gHitInfo.__int_hitpos.Y - actor->int_pos().Y); objDist = approxDist(gHitInfo.int_hitpos().X - actor->int_pos().X, gHitInfo.int_hitpos().Y - actor->int_pos().Y);
} }
if (actor != gHitInfo.actor() && targetDist > objDist) if (actor != gHitInfo.actor() && targetDist > objDist)
@ -865,7 +865,7 @@ static void unicultThinkChase(DBloodActor* actor)
bool immune = nnExtIsImmune(hitactor, gVectorData[curWeapon].dmgType); bool immune = nnExtIsImmune(hitactor, gVectorData[curWeapon].dmgType);
if (!(hitactor->hasX() && (!immune || (immune && hitactor->spr.statnum == kStatThing && hitactor->xspr.Vector)) && !hitactor->xspr.locked)) 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) if ((approxDist(gHitInfo.int_hitpos().X - actor->int_pos().X, gHitInfo.int_hitpos().Y - actor->int_pos().Y) <= 1500 && !blck)
|| (dist <= (int)(pExtra->fireDist / ClipLow(Random(4), 1)))) || (dist <= (int)(pExtra->fireDist / ClipLow(Random(4), 1))))
{ {
//viewSetSystemMessage("GO CHASE"); //viewSetSystemMessage("GO CHASE");
@ -940,8 +940,8 @@ static void unicultThinkChase(DBloodActor* actor)
case kMissileFireballTchernobog: case kMissileFireballTchernobog:
{ {
// allow attack if dude is far from object, but target is close to it // allow attack if dude is far from object, but target is close to it
int dudeDist = approxDist(gHitInfo.__int_hitpos.X - actor->int_pos().X, gHitInfo.__int_hitpos.Y - actor->int_pos().Y); int dudeDist = approxDist(gHitInfo.int_hitpos().X - actor->int_pos().X, gHitInfo.int_hitpos().Y - actor->int_pos().Y);
int targetDist1 = approxDist(gHitInfo.__int_hitpos.X - target->int_pos().X, gHitInfo.__int_hitpos.Y - target->int_pos().Y); int targetDist1 = approxDist(gHitInfo.int_hitpos().X - target->int_pos().X, gHitInfo.int_hitpos().Y - target->int_pos().Y);
if (dudeDist < mdist) if (dudeDist < mdist)
{ {
//viewSetSystemMessage("DUDE CLOSE TO OBJ: %d, MDIST: %d", dudeDist, mdist); //viewSetSystemMessage("DUDE CLOSE TO OBJ: %d, MDIST: %d", dudeDist, mdist);

View file

@ -413,13 +413,13 @@ int HitScan(DBloodActor* actor, int z, int dx, int dy, int dz, unsigned int nMas
if (!pWall->twoSided()) if (!pWall->twoSided())
return 0; return 0;
int nZCeil, nZFloor; int nZCeil, nZFloor;
getzsofslopeptr(pWall->nextSector(), gHitInfo.__int_hitpos.X, gHitInfo.__int_hitpos.Y, &nZCeil, &nZFloor); getzsofslopeptr(pWall->nextSector(), gHitInfo.int_hitpos().X, gHitInfo.int_hitpos().Y, &nZCeil, &nZFloor);
if (gHitInfo.__int_hitpos.Z <= nZCeil || gHitInfo.__int_hitpos.Z >= nZFloor) if (gHitInfo.int_hitpos().Z <= nZCeil || gHitInfo.int_hitpos().Z >= nZFloor)
return 0; return 0;
return 4; return 4;
} }
if (gHitInfo.hitSector != nullptr) if (gHitInfo.hitSector != nullptr)
return 1 + (z < gHitInfo.__int_hitpos.Z); return 1 + (z < gHitInfo.int_hitpos().Z);
return -1; return -1;
} }
@ -456,7 +456,7 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
actor->spr.cstat = bakCstat; actor->spr.cstat = bakCstat;
while (nNum--) while (nNum--)
{ {
if (nRange && approxDist(gHitInfo.__int_hitpos.X - actor->int_pos().X, gHitInfo.__int_hitpos.Y - actor->int_pos().Y) > nRange) if (nRange && approxDist(gHitInfo.int_hitpos().X - actor->int_pos().X, gHitInfo.int_hitpos().Y - actor->int_pos().Y) > nRange)
return -1; return -1;
auto other = gHitInfo.actor(); auto other = gHitInfo.actor();
if (other != nullptr) if (other != nullptr)
@ -476,7 +476,7 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
if (nTopOfs) if (nTopOfs)
otherZ -= (nTopOfs * other->spr.yrepeat) << 2; otherZ -= (nTopOfs * other->spr.yrepeat) << 2;
assert(height > 0); assert(height > 0);
int height2 = Scale(otherZ - gHitInfo.__int_hitpos.Z, tileHeight(nPicnum), height); int height2 = Scale(otherZ - gHitInfo.int_hitpos().Z, tileHeight(nPicnum), height);
if (!(other->spr.cstat & CSTAT_SPRITE_YFLIP)) if (!(other->spr.cstat & CSTAT_SPRITE_YFLIP))
height2 = tileHeight(nPicnum) - height2; height2 = tileHeight(nPicnum) - height2;
if (height2 >= 0 && height2 < tileHeight(nPicnum)) if (height2 >= 0 && height2 < tileHeight(nPicnum))
@ -498,7 +498,7 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
bakCstat = other->spr.cstat; bakCstat = other->spr.cstat;
other->spr.cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN; other->spr.cstat &= ~CSTAT_SPRITE_BLOCK_HITSCAN;
gHitInfo.clearObj(); gHitInfo.clearObj();
pos = gHitInfo.__int_hitpos; // must make a copy! pos = gHitInfo.int_hitpos(); // must make a copy!
hitscan(pos, other->sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); hitscan(pos, other->sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1);
other->spr.cstat = bakCstat; other->spr.cstat = bakCstat;
continue; continue;
@ -511,10 +511,10 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
sectortype* pSector = gHitInfo.hitSector; sectortype* pSector = gHitInfo.hitSector;
sectortype* pSectorNext = pWall->nextSector(); sectortype* pSectorNext = pWall->nextSector();
int nZCeil, nZFloor; int nZCeil, nZFloor;
getzsofslopeptr(pWall->nextSector(), gHitInfo.__int_hitpos.X, gHitInfo.__int_hitpos.Y, &nZCeil, &nZFloor); getzsofslopeptr(pWall->nextSector(), gHitInfo.int_hitpos().X, gHitInfo.int_hitpos().Y, &nZCeil, &nZFloor);
if (gHitInfo.__int_hitpos.Z <= nZCeil) if (gHitInfo.int_hitpos().Z <= nZCeil)
return 0; return 0;
if (gHitInfo.__int_hitpos.Z >= nZFloor) if (gHitInfo.int_hitpos().Z >= nZFloor)
{ {
if (!(pSector->floorstat & CSTAT_SECTOR_SKY) || !(pSectorNext->floorstat & CSTAT_SECTOR_SKY)) if (!(pSector->floorstat & CSTAT_SECTOR_SKY) || !(pSectorNext->floorstat & CSTAT_SECTOR_SKY))
return 0; return 0;
@ -527,7 +527,7 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
nOfs = ClipHigh(pSector->int_floorz(), pSectorNext->int_floorz()); nOfs = ClipHigh(pSector->int_floorz(), pSectorNext->int_floorz());
else else
nOfs = ClipLow(pSector->int_ceilingz(), pSectorNext->int_ceilingz()); nOfs = ClipLow(pSector->int_ceilingz(), pSectorNext->int_ceilingz());
nOfs = (gHitInfo.__int_hitpos.Z - nOfs) >> 8; nOfs = (gHitInfo.int_hitpos().Z - nOfs) >> 8;
if (pWall->cstat & CSTAT_WALL_YFLIP) if (pWall->cstat & CSTAT_WALL_YFLIP)
nOfs = -nOfs; nOfs = -nOfs;
@ -542,9 +542,9 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
int nLength = approxDist(pWall->wall_int_pos().X - pWall->point2Wall()->wall_int_pos().X, pWall->wall_int_pos().Y - pWall->point2Wall()->wall_int_pos().Y); int nLength = approxDist(pWall->wall_int_pos().X - pWall->point2Wall()->wall_int_pos().X, pWall->wall_int_pos().Y - pWall->point2Wall()->wall_int_pos().Y);
int nHOffset; int nHOffset;
if (pWall->cstat & CSTAT_WALL_XFLIP) if (pWall->cstat & CSTAT_WALL_XFLIP)
nHOffset = approxDist(gHitInfo.__int_hitpos.X - pWall->point2Wall()->wall_int_pos().X, gHitInfo.__int_hitpos.Y - pWall->point2Wall()->wall_int_pos().Y); nHOffset = approxDist(gHitInfo.int_hitpos().X - pWall->point2Wall()->wall_int_pos().X, gHitInfo.int_hitpos().Y - pWall->point2Wall()->wall_int_pos().Y);
else else
nHOffset = approxDist(gHitInfo.__int_hitpos.X - pWall->wall_int_pos().X, gHitInfo.__int_hitpos.Y - pWall->wall_int_pos().Y); nHOffset = approxDist(gHitInfo.int_hitpos().X - pWall->wall_int_pos().X, gHitInfo.int_hitpos().Y - pWall->wall_int_pos().Y);
nHOffset = pWall->xpan() + ((nHOffset * pWall->xrepeat) << 3) / nLength; nHOffset = pWall->xpan() + ((nHOffset * pWall->xrepeat) << 3) / nLength;
nHOffset %= nSizX; nHOffset %= nSizX;
@ -560,7 +560,7 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
auto bakCstat2 = pWall->nextWall()->cstat; auto bakCstat2 = pWall->nextWall()->cstat;
pWall->nextWall()->cstat &= ~CSTAT_WALL_BLOCK_HITSCAN; pWall->nextWall()->cstat &= ~CSTAT_WALL_BLOCK_HITSCAN;
gHitInfo.clearObj(); gHitInfo.clearObj();
pos = gHitInfo.__int_hitpos; pos = gHitInfo.int_hitpos();
hitscan(pos, pWall->nextSector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); hitscan(pos, pWall->nextSector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1);
pWall->cstat = bakCstat1; pWall->cstat = bakCstat1;
@ -577,9 +577,9 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
if (!upper) return 2; if (!upper) return 2;
auto link = upper->GetOwner(); auto link = upper->GetOwner();
gHitInfo.clearObj(); gHitInfo.clearObj();
x1 = gHitInfo.__int_hitpos.X + link->int_pos().X - upper->int_pos().X; x1 = gHitInfo.int_hitpos().X + link->int_pos().X - upper->int_pos().X;
y1 = gHitInfo.__int_hitpos.Y + link->int_pos().Y - upper->int_pos().Y; y1 = gHitInfo.int_hitpos().Y + link->int_pos().Y - upper->int_pos().Y;
z1 = gHitInfo.__int_hitpos.Z + link->int_pos().Z - upper->int_pos().Z; z1 = gHitInfo.int_hitpos().Z + link->int_pos().Z - upper->int_pos().Z;
pos = { x1, y1, z1 }; pos = { x1, y1, z1 };
hitscan(pos, link->sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); hitscan(pos, link->sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1);
@ -591,9 +591,9 @@ int VectorScan(DBloodActor* actor, int nOffset, int nZOffset, int dx, int dy, in
if (!lower) return 1; if (!lower) return 1;
auto link = lower->GetOwner(); auto link = lower->GetOwner();
gHitInfo.clearObj(); gHitInfo.clearObj();
x1 = gHitInfo.__int_hitpos.X + link->int_pos().X - lower->int_pos().X; x1 = gHitInfo.int_hitpos().X + link->int_pos().X - lower->int_pos().X;
y1 = gHitInfo.__int_hitpos.Y + link->int_pos().Y - lower->int_pos().Y; y1 = gHitInfo.int_hitpos().Y + link->int_pos().Y - lower->int_pos().Y;
z1 = gHitInfo.__int_hitpos.Z + link->int_pos().Z - lower->int_pos().Z; z1 = gHitInfo.int_hitpos().Z + link->int_pos().Z - lower->int_pos().Z;
pos = { x1, y1, z1 }; pos = { x1, y1, z1 };
hitscan(pos, link->sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1); hitscan(pos, link->sector(), { dx, dy, dz << 4 }, gHitInfo, CLIPMASK1);
continue; continue;

View file

@ -7710,7 +7710,7 @@ bool nnExtCanMove(DBloodActor* actor, DBloodActor* target, int nAngle, int nRang
int x = actor->int_pos().X, y = actor->int_pos().Y, z = actor->int_pos().Z; int x = actor->int_pos().X, y = actor->int_pos().Y, z = actor->int_pos().Z;
auto pSector = actor->sector(); auto pSector = actor->sector();
HitScan(actor, z, Cos(nAngle) >> 16, Sin(nAngle) >> 16, 0, CLIPMASK0, nRange); HitScan(actor, z, Cos(nAngle) >> 16, Sin(nAngle) >> 16, 0, CLIPMASK0, nRange);
int nDist = approxDist(x - gHitInfo.__int_hitpos.X, y - gHitInfo.__int_hitpos.Y); int nDist = approxDist(x - gHitInfo.int_hitpos().X, y - gHitInfo.int_hitpos().Y);
if (target != nullptr && nDist - (actor->spr.clipdist << 2) < nRange) if (target != nullptr && nDist - (actor->spr.clipdist << 2) < nRange)
return (target == gHitInfo.actor()); return (target == gHitInfo.actor());

View file

@ -1425,7 +1425,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
int y = bsin(plActor->int_ang()); int y = bsin(plActor->int_ang());
int z = pPlayer->slope; int z = pPlayer->slope;
int hit = HitScan(pPlayer->actor, pPlayer->zView, x, y, z, 0x10000040, 128); int hit = HitScan(pPlayer->actor, pPlayer->zView, x, y, z, 0x10000040, 128);
int hitDist = approxDist(plActor->int_pos().X - gHitInfo.__int_hitpos.X, plActor->int_pos().Y - gHitInfo.__int_hitpos.Y) >> 4; int hitDist = approxDist(plActor->int_pos().X - gHitInfo.int_hitpos().X, plActor->int_pos().Y - gHitInfo.int_hitpos().Y) >> 4;
if (hitDist < 64) if (hitDist < 64)
{ {
switch (hit) switch (hit)

View file

@ -4945,7 +4945,7 @@ int furthestangle(DDukeActor *actor, int angs)
{ {
hitscan({ actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8) }, actor->sector(), { bcos(j), bsin(j), 0 }, hit, CLIPMASK1); hitscan({ actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (8 << 8) }, actor->sector(), { bcos(j), bsin(j), 0 }, hit, CLIPMASK1);
d = abs(hit.__int_hitpos.X - actor->int_pos().X) + abs(hit.__int_hitpos.Y - actor->int_pos().Y); d = abs(hit.int_hitpos().X - actor->int_pos().X) + abs(hit.int_hitpos().Y - actor->int_pos().Y);
if (d > greatestd) if (d > greatestd)
{ {
@ -4978,14 +4978,14 @@ int furthestcanseepoint(DDukeActor *actor, DDukeActor* tosee, int* dax, int* day
{ {
hitscan({ tosee->int_pos().X, tosee->int_pos().Y, tosee->int_pos().Z - (16 << 8) }, tosee->sector(), { bcos(j), bsin(j), 16384 - (krand() & 32767) }, hit, CLIPMASK1); hitscan({ tosee->int_pos().X, tosee->int_pos().Y, tosee->int_pos().Z - (16 << 8) }, tosee->sector(), { bcos(j), bsin(j), 16384 - (krand() & 32767) }, hit, CLIPMASK1);
d = abs(hit.__int_hitpos.X - tosee->int_pos().X) + abs(hit.__int_hitpos.Y - tosee->int_pos().Y); d = abs(hit.int_hitpos().X - tosee->int_pos().X) + abs(hit.int_hitpos().Y - tosee->int_pos().Y);
da = abs(hit.__int_hitpos.X - actor->int_pos().X) + abs(hit.__int_hitpos.Y - actor->int_pos().Y); da = abs(hit.int_hitpos().X - actor->int_pos().X) + abs(hit.int_hitpos().Y - actor->int_pos().Y);
if (d < da && hit.hitSector) if (d < da && hit.hitSector)
if (cansee(hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, hit.hitSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (16 << 8), actor->sector())) if (cansee(hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, hit.hitSector, actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z - (16 << 8), actor->sector()))
{ {
*dax = hit.__int_hitpos.X; *dax = hit.int_hitpos().X;
*day = hit.__int_hitpos.Y; *day = hit.int_hitpos().Y;
return 1; return 1;
} }
} }

View file

@ -176,7 +176,7 @@ int hits(DDukeActor* actor)
auto pos = actor->int_pos(); auto pos = actor->int_pos();
hitscan(pos.withZOffset(-zoff), actor->sector(), { bcos(actor->int_ang()), bsin(actor->int_ang()), 0 }, hit, CLIPMASK1); hitscan(pos.withZOffset(-zoff), actor->sector(), { bcos(actor->int_ang()), bsin(actor->int_ang()), 0 }, hit, CLIPMASK1);
return (FindDistance2D(hit.__int_hitpos.vec2 - actor->int_pos().vec2)); return (FindDistance2D(hit.int_hitpos().vec2 - actor->int_pos().vec2));
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -202,7 +202,7 @@ int hitasprite(DDukeActor* actor, DDukeActor** hitsp)
if (hit.hitWall != nullptr && (hit.hitWall->cstat & CSTAT_WALL_MASKED) && badguy(actor)) if (hit.hitWall != nullptr && (hit.hitWall->cstat & CSTAT_WALL_MASKED) && badguy(actor))
return((1 << 30)); return((1 << 30));
return (FindDistance2D(hit.__int_hitpos.vec2 - actor->int_pos().vec2)); return (FindDistance2D(hit.int_hitpos().vec2 - actor->int_pos().vec2));
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -218,7 +218,7 @@ int hitawall(player_struct* p, walltype** hitw)
hitscan(p->player_int_pos(), p->cursector, { int(p->angle.ang.Cos() * (1 << 14)), int(p->angle.ang.Sin() * (1 << 14)), 0 }, hit, CLIPMASK0); hitscan(p->player_int_pos(), p->cursector, { int(p->angle.ang.Cos() * (1 << 14)), int(p->angle.ang.Sin() * (1 << 14)), 0 }, hit, CLIPMASK0);
if (hitw) *hitw = hit.hitWall; if (hitw) *hitw = hit.hitWall;
return (FindDistance2D(hit.__int_hitpos.vec2 - p->player_int_pos().vec2)); return (FindDistance2D(hit.int_hitpos().vec2 - p->player_int_pos().vec2));
} }
@ -1027,7 +1027,7 @@ void shootbloodsplat(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
hitscan({ sx, sy, sz }, sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1); hitscan({ sx, sy, sz }, sectp, { bcos(sa), bsin(sa), zvel << 6 }, hit, CLIPMASK1);
// oh my... // oh my...
if (FindDistance2D(sx - hit.__int_hitpos.X, sy - hit.__int_hitpos.Y) < 1024 && if (FindDistance2D(sx - hit.int_hitpos().X, sy - hit.int_hitpos().Y) < 1024 &&
(hit.hitWall != nullptr && hit.hitWall->overpicnum != BIGFORCE) && (hit.hitWall != nullptr && hit.hitWall->overpicnum != BIGFORCE) &&
((hit.hitWall->twoSided() && hit.hitSector != nullptr && ((hit.hitWall->twoSided() && hit.hitSector != nullptr &&
hit.hitWall->nextSector()->lotag == 0 && hit.hitWall->nextSector()->lotag == 0 &&
@ -1059,7 +1059,7 @@ void shootbloodsplat(DDukeActor* actor, int p, int sx, int sy, int sz, int sa, i
spawned->spr.xvel = -12; spawned->spr.xvel = -12;
auto delta = hit.hitWall->delta(); auto delta = hit.hitWall->delta();
spawned->set_int_ang(getangle(-delta.X, -delta.Y) + 512); // note the '-' sign here! spawned->set_int_ang(getangle(-delta.X, -delta.Y) + 512); // note the '-' sign here!
spawned->set_int_pos(hit.__int_hitpos); spawned->set_int_pos(hit.int_hitpos());
spawned->spr.cstat |= randomXFlip(); spawned->spr.cstat |= randomXFlip();
ssp(spawned, CLIPMASK0); ssp(spawned, CLIPMASK0);
SetActor(spawned, spawned->int_pos()); SetActor(spawned, spawned->int_pos());

View file

@ -250,11 +250,11 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
if (hit.hitSector == nullptr) return; if (hit.hitSector == nullptr) return;
if ((abs(sx - hit.__int_hitpos.X) + abs(sy - hit.__int_hitpos.Y)) < 1024) if ((abs(sx - hit.int_hitpos().X) + abs(sy - hit.int_hitpos().Y)) < 1024)
{ {
if (hit.hitWall || hit.actor()) if (hit.hitWall || hit.actor())
{ {
auto knee = EGS(hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, KNEE, -15, 0, 0, sa, 32, 0, actor, 4); auto knee = EGS(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, KNEE, -15, 0, 0, sa, 32, 0, actor, 4);
if (knee) if (knee)
{ {
knee->spr.extra += (krand() & 7); knee->spr.extra += (krand() & 7);
@ -278,12 +278,12 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
{ {
if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP) if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP)
if (hit.hitWall->twoSided()) if (hit.hitWall->twoSided())
if (hit.__int_hitpos.Z >= (hit.hitWall->nextSector()->int_floorz())) if (hit.int_hitpos().Z >= (hit.hitWall->nextSector()->int_floorz()))
hit.hitWall =hit.hitWall->nextWall(); hit.hitWall =hit.hitWall->nextWall();
if (hit.hitWall->picnum != ACCESSSWITCH && hit.hitWall->picnum != ACCESSSWITCH2) if (hit.hitWall->picnum != ACCESSSWITCH && hit.hitWall->picnum != ACCESSSWITCH2)
{ {
fi.checkhitwall(knee, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, KNEE); fi.checkhitwall(knee, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, KNEE);
if (p >= 0) fi.checkhitswitch(p, hit.hitWall, nullptr); if (p >= 0) fi.checkhitswitch(p, hit.hitWall, nullptr);
} }
} }
@ -293,7 +293,7 @@ static void shootknee(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
auto splash = spawn(ps[p].GetActor(), WATERSPLASH2); auto splash = spawn(ps[p].GetActor(), WATERSPLASH2);
if (splash) if (splash)
{ {
splash->set_int_xy(hit.__int_hitpos.X, hit.__int_hitpos.Y); splash->set_int_xy(hit.int_hitpos().X, hit.int_hitpos().Y);
splash->set_int_ang(ps[p].angle.ang.Buildang()); // Total tweek splash->set_int_ang(ps[p].angle.ang.Buildang()); // Total tweek
splash->spr.xvel = 32; splash->spr.xvel = 32;
ssp(actor, CLIPMASK0); ssp(actor, CLIPMASK0);
@ -403,12 +403,12 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
if (hit.hitSector == nullptr) return; if (hit.hitSector == nullptr) return;
if ((krand() & 15) == 0 && hit.hitSector->lotag == 2) if ((krand() & 15) == 0 && hit.hitSector->lotag == 2)
tracers(hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, sx, sy, sz, 8 - (ud.multimode >> 1)); tracers(hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, sx, sy, sz, 8 - (ud.multimode >> 1));
DDukeActor* spark; DDukeActor* spark;
if (p >= 0) if (p >= 0)
{ {
spark = EGS(hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4); spark = EGS(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4);
if (!spark) return; if (!spark) return;
spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress]; spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
@ -522,15 +522,15 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP) if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP)
if (hit.hitWall->twoSided()) if (hit.hitWall->twoSided())
if (hit.__int_hitpos.Z >= (hit.hitWall->nextSector()->int_floorz())) if (hit.int_hitpos().Z >= (hit.hitWall->nextSector()->int_floorz()))
hit.hitWall = hit.hitWall->nextWall(); hit.hitWall = hit.hitWall->nextWall();
fi.checkhitwall(spark, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, SHOTSPARK1); fi.checkhitwall(spark, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTSPARK1);
} }
} }
else else
{ {
spark = EGS(hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4); spark = EGS(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4);
if (spark) if (spark)
{ {
spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress]; spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
@ -543,14 +543,13 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
else spark->spr.xrepeat = spark->spr.yrepeat = 0; else spark->spr.xrepeat = spark->spr.yrepeat = 0;
} }
else if (hit.hitWall) else if (hit.hitWall)
fi.checkhitwall(spark, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, SHOTSPARK1); fi.checkhitwall(spark, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTSPARK1);
} }
} }
if ((krand() & 255) < 4) if ((krand() & 255) < 4)
{ {
vec3_t v{ hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z }; S_PlaySound3D(PISTOL_RICOCHET, spark, hit.int_hitpos());
S_PlaySound3D(PISTOL_RICOCHET, spark, v);
} }
} }
@ -851,7 +850,7 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
if (hit.hitWall && hit.hitSector) if (hit.hitWall && hit.hitSector)
{ {
if (((hit.__int_hitpos.X - sx) * (hit.__int_hitpos.X - sx) + (hit.__int_hitpos.Y - sy) * (hit.__int_hitpos.Y - sy)) < (290 * 290)) if (((hit.int_hitpos().X - sx) * (hit.int_hitpos().X - sx) + (hit.int_hitpos().Y - sy) * (hit.int_hitpos().Y - sy)) < (290 * 290))
{ {
if (hit.hitWall->twoSided()) if (hit.hitWall->twoSided())
{ {
@ -864,7 +863,7 @@ static void shootlaser(DDukeActor* actor, int p, int sx, int sy, int sz, int sa)
if (j == 1) if (j == 1)
{ {
auto bomb = EGS(hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, TRIPBOMB, -16, 4, 5, sa, 0, 0, actor, STAT_STANDABLE); auto bomb = EGS(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, TRIPBOMB, -16, 4, 5, sa, 0, 0, actor, STAT_STANDABLE);
if (!bomb) return; if (!bomb) return;
if (isWW2GI()) if (isWW2GI())
{ {
@ -962,7 +961,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int
actor->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL; actor->spr.cstat |= CSTAT_SPRITE_BLOCK_ALL;
auto spark = EGS(sect, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, GROWSPARK, -16, 28, 28, sa, 0, 0, actor, 1); auto spark = EGS(sect, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, GROWSPARK, -16, 28, 28, sa, 0, 0, actor, 1);
if (!spark) return; if (!spark) return;
spark->spr.pal = 2; spark->spr.pal = 2;
@ -979,7 +978,7 @@ static void shootgrowspark(DDukeActor* actor, int p, int sx, int sy, int sz, int
{ {
if (hit.hitWall->picnum != ACCESSSWITCH && hit.hitWall->picnum != ACCESSSWITCH2) if (hit.hitWall->picnum != ACCESSSWITCH && hit.hitWall->picnum != ACCESSSWITCH2)
{ {
fi.checkhitwall(spark, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, GROWSPARK); fi.checkhitwall(spark, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, GROWSPARK);
} }
} }
} }
@ -2027,13 +2026,13 @@ int operateTripbomb(int snum)
while ((act = it.Next())) while ((act = it.Next()))
{ {
if (!actorflag(act, SFLAG_BLOCK_TRIPBOMB) && if (!actorflag(act, SFLAG_BLOCK_TRIPBOMB) &&
abs(act->int_pos().Z - hit.__int_hitpos.Z) < (12 << 8) && ((act->int_pos().X - hit.__int_hitpos.X) * (act->int_pos().X - hit.__int_hitpos.X) + (act->int_pos().Y - hit.__int_hitpos.Y) * (act->int_pos().Y - hit.__int_hitpos.Y)) < (290 * 290)) abs(act->int_pos().Z - hit.int_hitpos().Z) < (12 << 8) && ((act->int_pos().X - hit.int_hitpos().X) * (act->int_pos().X - hit.int_hitpos().X) + (act->int_pos().Y - hit.int_hitpos().Y) * (act->int_pos().Y - hit.int_hitpos().Y)) < (290 * 290))
return 0; return 0;
} }
if (act == nullptr && hit.hitWall != nullptr && (hit.hitWall->cstat & CSTAT_WALL_MASKED) == 0) if (act == nullptr && hit.hitWall != nullptr && (hit.hitWall->cstat & CSTAT_WALL_MASKED) == 0)
if ((hit.hitWall->twoSided() && hit.hitWall->nextSector()->lotag <= 2) || (!hit.hitWall->twoSided() && hit.hitSector->lotag <= 2)) if ((hit.hitWall->twoSided() && hit.hitWall->nextSector()->lotag <= 2) || (!hit.hitWall->twoSided() && hit.hitSector->lotag <= 2))
if (((hit.__int_hitpos.X - p->player_int_pos().X) * (hit.__int_hitpos.X - p->player_int_pos().X) + (hit.__int_hitpos.Y - p->player_int_pos().Y) * (hit.__int_hitpos.Y - p->player_int_pos().Y)) < (290 * 290)) if (((hit.int_hitpos().X - p->player_int_pos().X) * (hit.int_hitpos().X - p->player_int_pos().X) + (hit.int_hitpos().Y - p->player_int_pos().Y) * (hit.int_hitpos().Y - p->player_int_pos().Y)) < (290 * 290))
{ {
p->pos.Z = p->opos.Z; p->pos.Z = p->opos.Z;
p->vel.Z = 0; p->vel.Z = 0;

View file

@ -115,8 +115,8 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
&& effector->spr.lotag == SE_7_TELEPORT) && effector->spr.lotag == SE_7_TELEPORT)
{ {
int nx, ny, nz; int nx, ny, nz;
nx = hit.__int_hitpos.X + (effector->GetOwner()->int_pos().X - effector->int_pos().X); nx = hit.int_hitpos().X + (effector->GetOwner()->int_pos().X - effector->int_pos().X);
ny = hit.__int_hitpos.Y + (effector->GetOwner()->int_pos().Y - effector->int_pos().Y); ny = hit.int_hitpos().Y + (effector->GetOwner()->int_pos().Y - effector->int_pos().Y);
if (hit.hitSector->lotag == 161) if (hit.hitSector->lotag == 161)
{ {
nz = effector->GetOwner()->sector()->int_floorz(); nz = effector->GetOwner()->sector()->int_floorz();
@ -133,20 +133,20 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
if (hit.hitSector == nullptr) return; if (hit.hitSector == nullptr) return;
if ((abs(sx - hit.__int_hitpos.X) + abs(sy - hit.__int_hitpos.Y)) < 1024) if ((abs(sx - hit.int_hitpos().X) + abs(sy - hit.int_hitpos().Y)) < 1024)
{ {
if (hit.hitWall != nullptr || hit.actor()) if (hit.hitWall != nullptr || hit.actor())
{ {
DDukeActor* wpn; DDukeActor* wpn;
if (isRRRA() && atwith == SLINGBLADE) if (isRRRA() && atwith == SLINGBLADE)
{ {
wpn = EGS(hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, SLINGBLADE, -15, 0, 0, sa, 32, 0, actor, 4); wpn = EGS(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SLINGBLADE, -15, 0, 0, sa, 32, 0, actor, 4);
if (!wpn) return; if (!wpn) return;
wpn->spr.extra += 50; wpn->spr.extra += 50;
} }
else else
{ {
wpn = EGS(hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, KNEE, -15, 0, 0, sa, 32, 0, actor, 4); wpn = EGS(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, KNEE, -15, 0, 0, sa, 32, 0, actor, 4);
if (!wpn) return; if (!wpn) return;
wpn->spr.extra += (krand() & 7); wpn->spr.extra += (krand() & 7);
} }
@ -170,12 +170,12 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
{ {
if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP) if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP)
if (hit.hitWall->twoSided()) if (hit.hitWall->twoSided())
if (hit.__int_hitpos.Z >= (hit.hitWall->nextSector()->int_floorz())) if (hit.int_hitpos().Z >= (hit.hitWall->nextSector()->int_floorz()))
hit.hitWall = hit.hitWall->nextWall(); hit.hitWall = hit.hitWall->nextWall();
if (hit.hitWall->picnum != ACCESSSWITCH && hit.hitWall->picnum != ACCESSSWITCH2) if (hit.hitWall->picnum != ACCESSSWITCH && hit.hitWall->picnum != ACCESSSWITCH2)
{ {
fi.checkhitwall(wpn, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, atwith); fi.checkhitwall(wpn, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, atwith);
if (p >= 0) fi.checkhitswitch(p, hit.hitWall, nullptr); if (p >= 0) fi.checkhitswitch(p, hit.hitWall, nullptr);
} }
} }
@ -185,7 +185,7 @@ static void shootmelee(DDukeActor *actor, int p, int sx, int sy, int sz, int sa,
auto splash = spawn(ps[p].GetActor(), WATERSPLASH2); auto splash = spawn(ps[p].GetActor(), WATERSPLASH2);
if (splash) if (splash)
{ {
splash->set_int_xy(hit.__int_hitpos.X, hit.__int_hitpos.Y); splash->set_int_xy(hit.int_hitpos().X, hit.int_hitpos().Y);
splash->set_int_ang(ps[p].angle.ang.Buildang()); // Total tweek splash->set_int_ang(ps[p].angle.ang.Buildang()); // Total tweek
splash->spr.xvel = 32; splash->spr.xvel = 32;
ssp(actor, 0); ssp(actor, 0);
@ -270,8 +270,8 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
&& effector->spr.lotag == SE_7_TELEPORT) && effector->spr.lotag == SE_7_TELEPORT)
{ {
int nx, ny, nz; int nx, ny, nz;
nx = hit.__int_hitpos.X + (effector->GetOwner()->int_pos().X - effector->int_pos().X); nx = hit.int_hitpos().X + (effector->GetOwner()->int_pos().X - effector->int_pos().X);
ny = hit.__int_hitpos.Y + (effector->GetOwner()->int_pos().Y - effector->int_pos().Y); ny = hit.int_hitpos().Y + (effector->GetOwner()->int_pos().Y - effector->int_pos().Y);
if (hit.hitSector->lotag == 161) if (hit.hitSector->lotag == 161)
{ {
nz = effector->GetOwner()->sector()->int_floorz(); nz = effector->GetOwner()->sector()->int_floorz();
@ -296,12 +296,12 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
return; return;
if ((krand() & 15) == 0 && hit.hitSector->lotag == 2) if ((krand() & 15) == 0 && hit.hitSector->lotag == 2)
tracers(hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, sx, sy, sz, 8 - (ud.multimode >> 1)); tracers(hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, sx, sy, sz, 8 - (ud.multimode >> 1));
DDukeActor* spark; DDukeActor* spark;
if (p >= 0) if (p >= 0)
{ {
spark = EGS(hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4); spark = EGS(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTSPARK1, -15, 10, 10, sa, 0, 0, actor, 4);
if (!spark) return; if (!spark) return;
spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress]; spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
spark->spr.extra += (krand() % 6); spark->spr.extra += (krand() % 6);
@ -421,15 +421,15 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP) if (hit.hitWall->cstat & CSTAT_WALL_BOTTOM_SWAP)
if (hit.hitWall->twoSided()) if (hit.hitWall->twoSided())
if (hit.__int_hitpos.Z >= (hit.hitWall->nextSector()->int_floorz())) if (hit.int_hitpos().Z >= (hit.hitWall->nextSector()->int_floorz()))
hit.hitWall = hit.hitWall->nextWall(); hit.hitWall = hit.hitWall->nextWall();
fi.checkhitwall(spark, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, SHOTSPARK1); fi.checkhitwall(spark, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTSPARK1);
} }
} }
else else
{ {
spark = EGS(hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4); spark = EGS(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTSPARK1, -15, 24, 24, sa, 0, 0, actor, 4);
if (!spark) return; if (!spark) return;
spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress]; spark->spr.extra = ScriptCode[gs.actorinfo[atwith].scriptaddress];
@ -441,13 +441,12 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
else spark->spr.xrepeat = spark->spr.yrepeat = 0; else spark->spr.xrepeat = spark->spr.yrepeat = 0;
} }
else if (hit.hitWall != nullptr) else if (hit.hitWall != nullptr)
fi.checkhitwall(spark, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, SHOTSPARK1); fi.checkhitwall(spark, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTSPARK1);
} }
if ((krand() & 255) < 10) if ((krand() & 255) < 10)
{ {
vec3_t v{ hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z }; S_PlaySound3D(PISTOL_RICOCHET, spark, hit.int_hitpos());
S_PlaySound3D(PISTOL_RICOCHET, spark, v);
} }
} }

View file

@ -434,9 +434,9 @@ MOVEEND:
else else
dz = -pBullet->nPitch * 512; dz = -pBullet->nPitch * 512;
hitscan(startPos, pActor->sector(), { bcos(pActor->int_ang()), bsin(pActor->int_ang()), dz }, hit, CLIPMASK1); hitscan(startPos, pActor->sector(), { bcos(pActor->int_ang()), bsin(pActor->int_ang()), dz }, hit, CLIPMASK1);
x2 = hit.__int_hitpos.X; x2 = hit.int_hitpos().X;
y2 = hit.__int_hitpos.Y; y2 = hit.int_hitpos().Y;
z2 = hit.__int_hitpos.Z; z2 = hit.int_hitpos().Z;
hitactor = hit.actor(); hitactor = hit.actor();
pHitSect = hit.hitSector; pHitSect = hit.hitSector;
pHitWall = hit.hitWall; pHitWall = hit.hitWall;

View file

@ -254,8 +254,8 @@ Collision CheckCloseRange(int nPlayer, int *x, int *y, int *z, sectortype* *ppSe
int ecx = bsin(150, -3); int ecx = bsin(150, -3);
uint32_t yDiff = abs(hit.__int_hitpos.Y - *y); uint32_t yDiff = abs(hit.int_hitpos().Y - *y);
uint32_t xDiff = abs(hit.__int_hitpos.X - *x); uint32_t xDiff = abs(hit.int_hitpos().X - *x);
uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff; uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff;
@ -270,9 +270,9 @@ Collision CheckCloseRange(int nPlayer, int *x, int *y, int *z, sectortype* *ppSe
if (ksqrt(sqrtNum) >= ecx) if (ksqrt(sqrtNum) >= ecx)
return c; return c;
*x = hit.__int_hitpos.X; *x = hit.int_hitpos().X;
*y = hit.__int_hitpos.Y; *y = hit.int_hitpos().Y;
*z = hit.__int_hitpos.Z; *z = hit.int_hitpos().Z;
*ppSector = hit.hitSector; *ppSector = hit.hitSector;
if (hit.actor()) { if (hit.actor()) {

View file

@ -399,8 +399,8 @@ void AILion::Tick(RunListEvent* ev)
if (hit.hitWall) if (hit.hitWall)
{ {
int theX = abs(hit.__int_hitpos.X - x); int theX = abs(hit.int_hitpos().X - x);
int theY = abs(hit.__int_hitpos.Y - y); int theY = abs(hit.int_hitpos().Y - y);
if ((theX + theY) < nCheckDist) if ((theX + theY) < nCheckDist)
{ {

View file

@ -141,8 +141,8 @@ void BuildSnake(int nPlayer, int zVal)
HitInfo hit{}; HitInfo hit{};
hitscan({ x, y, z }, pPlayerActor->sector(), { bcos(nAngle), bsin(nAngle), 0 }, hit, CLIPMASK1); hitscan({ x, y, z }, pPlayerActor->sector(), { bcos(nAngle), bsin(nAngle), 0 }, hit, CLIPMASK1);
uint32_t yDiff = abs(hit.__int_hitpos.Y - y); uint32_t yDiff = abs(hit.int_hitpos().Y - y);
uint32_t xDiff = abs(hit.__int_hitpos.X - x); uint32_t xDiff = abs(hit.int_hitpos().X - x);
uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff; uint32_t sqrtNum = xDiff * xDiff + yDiff * yDiff;
@ -158,7 +158,7 @@ void BuildSnake(int nPlayer, int zVal)
{ {
BackUpBullet(&hit.__int_hitpos.X, &hit.__int_hitpos.Y, nAngle); BackUpBullet(&hit.__int_hitpos.X, &hit.__int_hitpos.Y, nAngle);
auto pActor = insertActor(hit.hitSector, 202); auto pActor = insertActor(hit.hitSector, 202);
pActor->set_int_pos(hit.__int_hitpos); pActor->set_int_pos(hit.int_hitpos());
ExplodeSnakeSprite(pActor, nPlayer); ExplodeSnakeSprite(pActor, nPlayer);
DeleteActor(pActor); DeleteActor(pActor);

View file

@ -441,7 +441,7 @@ int DoActorOperate(DSWActor* actor)
neartag({ actor->int_pos().X, actor->int_pos().Y, z[i] }, actor->sector(), actor->int_ang(), near, 1024, NTAG_SEARCH_LO_HI); neartag({ actor->int_pos().X, actor->int_pos().Y, z[i] }, actor->sector(), actor->int_ang(), near, 1024, NTAG_SEARCH_LO_HI);
} }
if (near.hitSector != nullptr && near.__int_hitpos.X < 1024) if (near.hitSector != nullptr && near.int_hitpos().X < 1024)
{ {
if (OperateSector(near.hitSector, false)) if (OperateSector(near.hitSector, false))
{ {

View file

@ -950,8 +950,8 @@ void CircleCamera(int *nx, int *ny, int *nz, sectortype** vsect, DAngle *nang, f
actor->spr.cstat = bakcstat; // Restore cstat actor->spr.cstat = bakcstat; // Restore cstat
hx = hit.__int_hitpos.X - (*nx); hx = hit.int_hitpos().X - (*nx);
hy = hit.__int_hitpos.Y - (*ny); hy = hit.int_hitpos().Y - (*ny);
// If something is in the way, make pp->circle_camera_dist lower if necessary // If something is in the way, make pp->circle_camera_dist lower if necessary
if (abs(vx) + abs(vy) > abs(hx) + abs(hy)) if (abs(vx) + abs(vy) > abs(hx) + abs(hy))

View file

@ -1607,7 +1607,7 @@ enum
short SoundDist(int x, int y, int z, int basedist); short SoundDist(int x, int y, int z, int basedist);
short SoundAngle(int x, int y); short SoundAngle(int x, int y);
//void PlaySound(int num, short angle, short vol); //void PlaySound(int num, short angle, short vol);
int _PlaySound(int num, DSWActor* sprite, PLAYER* player, vec3_t *pos, int flags, int channel, EChanFlags sndflags); int _PlaySound(int num, DSWActor* sprite, PLAYER* player, const vec3_t *const pos, int flags, int channel, EChanFlags sndflags);
void InitAmbient(int num, DSWActor* actor); void InitAmbient(int num, DSWActor* actor);
inline void PlaySound(int num, PLAYER* player, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE) inline void PlaySound(int num, PLAYER* player, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
@ -1622,6 +1622,10 @@ inline void PlaySound(int num, vec3_t *pos, int flags, int channel = 8, EChanFla
{ {
_PlaySound(num, nullptr, nullptr, pos, flags, channel, sndflags); _PlaySound(num, nullptr, nullptr, pos, flags, channel, sndflags);
} }
inline void PlaySound(int num, const vec3_t &pos, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
{
_PlaySound(num, nullptr, nullptr, &pos, flags, channel, sndflags);
}
int _PlayerSound(int num, PLAYER* pp); int _PlayerSound(int num, PLAYER* pp);
inline int PlayerSound(int num, int flags, PLAYER* pp) { return _PlayerSound(num, pp); } inline int PlayerSound(int num, int flags, PLAYER* pp) { return _PlayerSound(num, pp); }

View file

@ -1931,18 +1931,10 @@ void PlayerCheckValidMove(PLAYER* pp)
{ {
if (!pp->insector()) if (!pp->insector())
{ {
static int count = 0;
pp->pos.X = pp->oldpos.X; pp->pos.X = pp->oldpos.X;
pp->pos.Y = pp->oldpos.Y; pp->pos.Y = pp->oldpos.Y;
pp->pos.Z = pp->oldpos.Z; pp->pos.Z = pp->oldpos.Z;
pp->cursector = pp->lastcursector; pp->cursector = pp->lastcursector;
// if stuck here for more than 10 seconds
if (count++ > 40 * 10)
{
ASSERT(true == false);
}
} }
} }
@ -2621,7 +2613,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
{ MOVEx(256, pp->angle.ang.Buildang()), MOVEy(256, pp->angle.ang.Buildang()), 0 }, { MOVEx(256, pp->angle.ang.Buildang()), MOVEy(256, pp->angle.ang.Buildang()), 0 },
hit, CLIPMASK_PLAYER); hit, CLIPMASK_PLAYER);
if (FindDistance2D(hit.__int_hitpos.vec2 - hit_pos.vec2) < 800) if (FindDistance2D(hit.int_hitpos().vec2 - hit_pos.vec2) < 800)
{ {
if (hit.hitWall) if (hit.hitWall)
actor->user.coll.setWall(wallnum(hit.hitWall)); actor->user.coll.setWall(wallnum(hit.hitWall));
@ -3378,7 +3370,7 @@ int DoPlayerWadeSuperJump(PLAYER* pp)
if (hit.hitSector != nullptr && labs(hit.hitSector->int_floorz() - pp->pos.Z) < Z(50)) if (hit.hitSector != nullptr && labs(hit.hitSector->int_floorz() - pp->pos.Z) < Z(50))
{ {
if (Distance(pp->pos.X, pp->pos.Y, hit.__int_hitpos.X, hit.__int_hitpos.Y) < ((((int)pp->actor->spr.clipdist)<<2) + 256)) if (Distance(pp->pos.X, pp->pos.Y, hit.int_hitpos().X, hit.int_hitpos().Y) < ((((int)pp->actor->spr.clipdist)<<2) + 256))
return true; return true;
} }
} }
@ -3682,7 +3674,7 @@ bool PlayerOnLadder(PLAYER* pp)
{ {
neartag(pp->pos, pp->cursector, NORM_ANGLE(pp->angle.ang.Buildang() + angles[i]), near, 600, NTAG_SEARCH_LO_HI); neartag(pp->pos, pp->cursector, NORM_ANGLE(pp->angle.ang.Buildang() + angles[i]), near, 600, NTAG_SEARCH_LO_HI);
if (near.hitWall == nullptr || near.__int_hitpos.X < 100 || near.hitWall->lotag != TAG_WALL_CLIMB) if (near.hitWall == nullptr || near.int_hitpos().X < 100 || near.hitWall->lotag != TAG_WALL_CLIMB)
return false; return false;
FAFhitscan(pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector, FAFhitscan(pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector,
@ -3691,7 +3683,7 @@ bool PlayerOnLadder(PLAYER* pp)
0, 0,
hit, CLIPMASK_MISSILE); hit, CLIPMASK_MISSILE);
dist = DIST(pp->pos.X, pp->pos.Y, hit.__int_hitpos.X, hit.__int_hitpos.Y); dist = DIST(pp->pos.X, pp->pos.Y, hit.int_hitpos().X, hit.int_hitpos().Y);
if (hit.actor() != nullptr) if (hit.actor() != nullptr)
{ {

View file

@ -938,7 +938,7 @@ int InitRipperHang(DSWActor* actor)
if (hit.hitSector == nullptr) if (hit.hitSector == nullptr)
continue; continue;
dist = Distance(actor->int_pos().X, actor->int_pos().Y, hit.__int_hitpos.X, hit.__int_hitpos.Y); dist = Distance(actor->int_pos().X, actor->int_pos().Y, hit.int_hitpos().X, hit.int_hitpos().Y);
if (hit.hitWall == nullptr || dist < 2000 || dist > 7000) if (hit.hitWall == nullptr || dist < 2000 || dist > 7000)
{ {

View file

@ -947,7 +947,7 @@ int InitRipper2Hang(DSWActor* actor)
if (hit.hitSector == nullptr) if (hit.hitSector == nullptr)
continue; continue;
dist = Distance(actor->int_pos().X, actor->int_pos().Y, hit.__int_hitpos.X, hit.__int_hitpos.Y); dist = Distance(actor->int_pos().X, actor->int_pos().Y, hit.int_hitpos().X, hit.int_hitpos().Y);
if (hit.hitWall == nullptr || dist < 2000 || dist > 7000) if (hit.hitWall == nullptr || dist < 2000 || dist > 7000)
{ {

View file

@ -152,7 +152,7 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect,
ResetWallWarpHitscan(hit.hitSector); ResetWallWarpHitscan(hit.hitSector);
// NOTE: This could be recursive I think if need be // NOTE: This could be recursive I think if need be
auto pos = hit.__int_hitpos; auto pos = hit.int_hitpos();
hitscan(pos, hit.hitSector, { xvect, yvect, zvect }, hit, startclipmask); hitscan(pos, hit.hitSector, { xvect, yvect, zvect }, hit, startclipmask);
// reset hitscan block for dest sect // reset hitscan block for dest sect
@ -179,7 +179,7 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect,
sectortype* newsect = nullptr; sectortype* newsect = nullptr;
if (Warp(&hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z, &newsect)) if (Warp(&hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z, &newsect))
{ {
auto pos = hit.__int_hitpos; auto pos = hit.int_hitpos();
hitscan(pos, newsect, { xvect, yvect, zvect }, hit, clipmask); hitscan(pos, newsect, { xvect, yvect, zvect }, hit, clipmask);
return; return;
} }
@ -189,27 +189,27 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect,
sectortype* newsect = nullptr; sectortype* newsect = nullptr;
if (WarpPlane(&hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z, &newsect)) if (WarpPlane(&hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z, &newsect))
{ {
auto pos = hit.__int_hitpos; auto pos = hit.int_hitpos();
hitscan(pos, newsect, { xvect, yvect, zvect }, hit, clipmask); hitscan(pos, newsect, { xvect, yvect, zvect }, hit, clipmask);
return; return;
} }
} }
} }
getzsofslopeptr(hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, &hiz, &loz); getzsofslopeptr(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, &hiz, &loz);
if (abs(hit.__int_hitpos.Z - loz) < Z(4)) if (abs(hit.int_hitpos().Z - loz) < Z(4))
{ {
if (FAF_ConnectFloor(hit.hitSector) && !(hit.hitSector->floorstat & CSTAT_SECTOR_FAF_BLOCK_HITSCAN)) if (FAF_ConnectFloor(hit.hitSector) && !(hit.hitSector->floorstat & CSTAT_SECTOR_FAF_BLOCK_HITSCAN))
{ {
updatesectorz(hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z + Z(12), &newsector); updatesectorz(hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z + Z(12), &newsector);
plax_found = true; plax_found = true;
} }
} }
else if (labs(hit.__int_hitpos.Z - hiz) < Z(4)) else if (labs(hit.int_hitpos().Z - hiz) < Z(4))
{ {
if (FAF_ConnectCeiling(hit.hitSector) && !(hit.hitSector->floorstat & CSTAT_SECTOR_FAF_BLOCK_HITSCAN)) if (FAF_ConnectCeiling(hit.hitSector) && !(hit.hitSector->floorstat & CSTAT_SECTOR_FAF_BLOCK_HITSCAN))
{ {
updatesectorz(hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z - Z(12), &newsector); updatesectorz(hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z - Z(12), &newsector);
plax_found = true; plax_found = true;
} }
} }
@ -217,7 +217,7 @@ FAFhitscan(int32_t x, int32_t y, int32_t z, sectortype* sect,
if (plax_found) if (plax_found)
{ {
auto pos = hit.__int_hitpos; auto pos = hit.int_hitpos();
hitscan(pos, newsector, { xvect, yvect, zvect }, hit, clipmask); hitscan(pos, newsector, { xvect, yvect, zvect }, hit, clipmask);
} }
} }
@ -272,20 +272,20 @@ bool FAFcansee(int32_t xs, int32_t ys, int32_t zs, sectortype* sects,
// make sure it hit JUST a sector before doing a check // make sure it hit JUST a sector before doing a check
if (hit.hitWall == nullptr && hit.actor() == nullptr) if (hit.hitWall == nullptr && hit.actor() == nullptr)
{ {
getzsofslopeptr(hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, &hiz, &loz); getzsofslopeptr(hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, &hiz, &loz);
if (labs(hit.__int_hitpos.Z - loz) < Z(4)) if (labs(hit.int_hitpos().Z - loz) < Z(4))
{ {
if (FAF_ConnectFloor(hit.hitSector)) if (FAF_ConnectFloor(hit.hitSector))
{ {
updatesectorz(hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z + Z(12), &newsect); updatesectorz(hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z + Z(12), &newsect);
plax_found = true; plax_found = true;
} }
} }
else if (labs(hit.__int_hitpos.Z - hiz) < Z(4)) else if (labs(hit.int_hitpos().Z - hiz) < Z(4))
{ {
if (FAF_ConnectCeiling(hit.hitSector)) if (FAF_ConnectCeiling(hit.hitSector))
{ {
updatesectorz(hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z - Z(12), &newsect); updatesectorz(hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z - Z(12), &newsect);
plax_found = true; plax_found = true;
} }
} }
@ -296,7 +296,7 @@ bool FAFcansee(int32_t xs, int32_t ys, int32_t zs, sectortype* sects,
} }
if (plax_found) if (plax_found)
return !!cansee(hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, newsect, xe, ye, ze, secte); return !!cansee(hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, newsect, xe, ye, ze, secte);
return false; return false;
} }

View file

@ -1977,7 +1977,7 @@ bool NearThings(PLAYER* pp)
if (hit.hitSector == nullptr) if (hit.hitSector == nullptr)
return false; return false;
if (Distance(hit.__int_hitpos.X, hit.__int_hitpos.Y, pp->pos.X, pp->pos.Y) > 1500) if (Distance(hit.int_hitpos().X, hit.int_hitpos().Y, pp->pos.X, pp->pos.Y) > 1500)
return false; return false;
// hit a sprite? // hit a sprite?
@ -2023,7 +2023,7 @@ void NearTagList(NEAR_TAG_INFO* ntip, PLAYER* pp, int z, int dist, int type, int
save_lotag = ntsec->lotag; save_lotag = ntsec->lotag;
save_hitag = ntsec->hitag; save_hitag = ntsec->hitag;
ntip->dist = near.__int_hitpos.X; ntip->dist = near.int_hitpos().X;
ntip->sectp = ntsec; ntip->sectp = ntsec;
ntip->wallp = nullptr; ntip->wallp = nullptr;
ntip->actor = nullptr; ntip->actor = nullptr;
@ -2050,7 +2050,7 @@ void NearTagList(NEAR_TAG_INFO* ntip, PLAYER* pp, int z, int dist, int type, int
save_lotag = ntwall->lotag; save_lotag = ntwall->lotag;
save_hitag = ntwall->hitag; save_hitag = ntwall->hitag;
ntip->dist = near.__int_hitpos.X; ntip->dist = near.int_hitpos().X;
ntip->sectp = nullptr; ntip->sectp = nullptr;
ntip->wallp = ntwall; ntip->wallp = ntwall;
ntip->actor = nullptr; ntip->actor = nullptr;
@ -2077,7 +2077,7 @@ void NearTagList(NEAR_TAG_INFO* ntip, PLAYER* pp, int z, int dist, int type, int
save_lotag = actor->spr.lotag; save_lotag = actor->spr.lotag;
save_hitag = actor->spr.hitag; save_hitag = actor->spr.hitag;
ntip->dist = near.__int_hitpos.X; ntip->dist = near.int_hitpos().X;
ntip->sectp = nullptr; ntip->sectp = nullptr;
ntip->wallp = nullptr; ntip->wallp = nullptr;
ntip->actor = actor; ntip->actor = actor;

View file

@ -631,7 +631,7 @@ void GameInterface::UpdateSounds(void)
// //
//========================================================================== //==========================================================================
int _PlaySound(int num, DSWActor* actor, PLAYER* pp, vec3_t* ppos, int flags, int channel, EChanFlags cflags) int _PlaySound(int num, DSWActor* actor, PLAYER* pp, const vec3_t* const ppos, int flags, int channel, EChanFlags cflags)
{ {
if (Prediction || !SoundEnabled() || !soundEngine->isValidSoundId(num)) if (Prediction || !SoundEnabled() || !soundEngine->isValidSoundId(num))
return -1; return -1;

View file

@ -3107,7 +3107,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
{ {
neartag({ actor->int_pos().X, actor->int_pos().Y, z[i] }, actor->sector(), actor->int_ang(), near, 1024, NTAG_SEARCH_LO_HI); neartag({ actor->int_pos().X, actor->int_pos().Y, z[i] }, actor->sector(), actor->int_ang(), near, 1024, NTAG_SEARCH_LO_HI);
if (near.actor() != nullptr && near.__int_hitpos.X < 1024) if (near.actor() != nullptr && near.int_hitpos().X < 1024)
{ {
if (OperateSprite(near.actor(), false)) if (OperateSprite(near.actor(), false))
{ {
@ -3121,7 +3121,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
} }
} }
if (near.hitSector != nullptr && near.__int_hitpos.X < 1024) if (near.hitSector != nullptr && near.int_hitpos().X < 1024)
{ {
if (OperateSector(near.hitSector, false)) if (OperateSector(near.hitSector, false))
{ {

View file

@ -107,6 +107,23 @@ ANIMATOR DoFastShrapJumpFall;
int SpawnSmokePuff(DSWActor* actor); int SpawnSmokePuff(DSWActor* actor);
bool WarpToUnderwater(sectortype** sect, int *x, int *y, int *z); bool WarpToUnderwater(sectortype** sect, int *x, int *y, int *z);
bool WarpToSurface(sectortype** sect, int *x, int *y, int *z); bool WarpToSurface(sectortype** sect, int *x, int *y, int *z);
inline bool WarpToSurface(DVector3& pos, sectortype** sect)
{
vec3_t vv = { int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint) };
auto act = WarpToSurface(sect, &vv.X, &vv.Y, &vv.Z);
pos = { vv.X * inttoworld, vv.Y * inttoworld, vv.Z * zinttoworld };
return act;
}
inline bool WarpToUnderwater(DVector3& pos, sectortype** sect)
{
vec3_t vv = { int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint) };
auto act = WarpToUnderwater(sect, &vv.X, &vv.Y, &vv.Z);
pos = { vv.X * inttoworld, vv.Y * inttoworld, vv.Z * zinttoworld };
return act;
}
bool TestDontStickSector(sectortype* hit_sect); bool TestDontStickSector(sectortype* hit_sect);
ANIMATOR SpawnShrapX; ANIMATOR SpawnShrapX;
bool WeaponMoveHit(DSWActor* actor); bool WeaponMoveHit(DSWActor* actor);
@ -11858,7 +11875,7 @@ int InitSwordAttack(PLAYER* pp)
if (hit.hitSector == nullptr) if (hit.hitSector == nullptr)
return 0; return 0;
if (FindDistance3D(pp->pos - hit.__int_hitpos) < 700) if (FindDistance3D(pp->pos - hit.int_hitpos()) < 700)
{ {
if (hit.actor() != nullptr) if (hit.actor() != nullptr)
@ -11871,8 +11888,8 @@ int InitSwordAttack(PLAYER* pp)
switch (hitActor->user.ID) switch (hitActor->user.ID)
{ {
case ZILLA_RUN_R0: case ZILLA_RUN_R0:
SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
PlaySound(DIGI_SWORDCLANK, &hit.__int_hitpos, v3df_none); PlaySound(DIGI_SWORDCLANK, hit.int_hitpos(), v3df_none);
break; break;
case TRASHCAN: case TRASHCAN:
if (hitActor->user.WaitTics <= 0) if (hitActor->user.WaitTics <= 0)
@ -11880,8 +11897,8 @@ int InitSwordAttack(PLAYER* pp)
hitActor->user.WaitTics = SEC(2); hitActor->user.WaitTics = SEC(2);
ChangeState(hitActor, s_TrashCanPain); ChangeState(hitActor, s_TrashCanPain);
} }
SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
PlaySound(DIGI_SWORDCLANK, &hit.__int_hitpos, v3df_none); PlaySound(DIGI_SWORDCLANK, hit.int_hitpos(), v3df_none);
PlaySound(DIGI_TRASHLID, hitActor, v3df_none); PlaySound(DIGI_TRASHLID, hitActor, v3df_none);
break; break;
case PACHINKO1: case PACHINKO1:
@ -11889,8 +11906,8 @@ int InitSwordAttack(PLAYER* pp)
case PACHINKO3: case PACHINKO3:
case PACHINKO4: case PACHINKO4:
case 623: case 623:
SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
PlaySound(DIGI_SWORDCLANK, &hit.__int_hitpos, v3df_none); PlaySound(DIGI_SWORDCLANK, hit.int_hitpos(), v3df_none);
break; break;
} }
} }
@ -11920,7 +11937,7 @@ int InitSwordAttack(PLAYER* pp)
{ {
if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY)) if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY))
{ {
if (hit.__int_hitpos.Z < hit.hitWall->nextSector()->int_ceilingz()) if (hit.int_hitpos().Z < hit.hitWall->nextSector()->int_ceilingz())
{ {
return 0; return 0;
} }
@ -11929,13 +11946,13 @@ int InitSwordAttack(PLAYER* pp)
if (hit.hitWall->lotag == TAG_WALL_BREAK) if (hit.hitWall->lotag == TAG_WALL_BREAK)
{ {
HitBreakWall(hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, plActor->user.ID); HitBreakWall(hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, plActor->user.ID);
} }
// hit non breakable wall - do sound and puff // hit non breakable wall - do sound and puff
else else
{ {
SpawnSwordSparks(pp, hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); SpawnSwordSparks(pp, hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
PlaySound(DIGI_SWORDCLANK, &hit.__int_hitpos, v3df_none); PlaySound(DIGI_SWORDCLANK, hit.int_hitpos(), v3df_none);
} }
} }
} }
@ -12039,7 +12056,7 @@ int InitFistAttack(PLAYER* pp)
if (hit.hitSector == nullptr) if (hit.hitSector == nullptr)
return 0; return 0;
if (FindDistance3D(pp->pos - hit.__int_hitpos) < 700) if (FindDistance3D(pp->pos - hit.int_hitpos()) < 700)
{ {
if (hit.actor() != nullptr) if (hit.actor() != nullptr)
@ -12052,8 +12069,8 @@ int InitFistAttack(PLAYER* pp)
switch (hitActor->user.ID) switch (hitActor->user.ID)
{ {
case ZILLA_RUN_R0: case ZILLA_RUN_R0:
SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
PlaySound(DIGI_ARMORHIT, &hit.__int_hitpos, v3df_none); PlaySound(DIGI_ARMORHIT, hit.int_hitpos(), v3df_none);
break; break;
case TRASHCAN: case TRASHCAN:
if (hitActor->user.WaitTics <= 0) if (hitActor->user.WaitTics <= 0)
@ -12061,8 +12078,8 @@ int InitFistAttack(PLAYER* pp)
hitActor->user.WaitTics = SEC(2); hitActor->user.WaitTics = SEC(2);
ChangeState(hitActor, s_TrashCanPain); ChangeState(hitActor, s_TrashCanPain);
} }
SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
PlaySound(DIGI_ARMORHIT, &hit.__int_hitpos, v3df_none); PlaySound(DIGI_ARMORHIT, hit.int_hitpos(), v3df_none);
PlaySound(DIGI_TRASHLID, hitActor, v3df_none); PlaySound(DIGI_TRASHLID, hitActor, v3df_none);
break; break;
case PACHINKO1: case PACHINKO1:
@ -12070,8 +12087,8 @@ int InitFistAttack(PLAYER* pp)
case PACHINKO3: case PACHINKO3:
case PACHINKO4: case PACHINKO4:
case 623: case 623:
SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
PlaySound(DIGI_ARMORHIT, &hit.__int_hitpos, v3df_none); PlaySound(DIGI_ARMORHIT, hit.int_hitpos(), v3df_none);
break; break;
} }
} }
@ -12098,8 +12115,8 @@ int InitFistAttack(PLAYER* pp)
case 5062: case 5062:
case 5063: case 5063:
case 4947: case 4947:
SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); SpawnSwordSparks(pp, hit.hitSector, nullptr, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
PlaySound(DIGI_ARMORHIT, &hit.__int_hitpos, v3df_none); PlaySound(DIGI_ARMORHIT, hit.int_hitpos(), v3df_none);
if (RandomRange(1000) > 700) if (RandomRange(1000) > 700)
PlayerUpdateHealth(pp,1); // Give some health PlayerUpdateHealth(pp,1); // Give some health
hitActor->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN); hitActor->spr.cstat |= (CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
@ -12114,7 +12131,7 @@ int InitFistAttack(PLAYER* pp)
{ {
if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY)) if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY))
{ {
if (hit.__int_hitpos.Z < hit.hitWall->nextSector()->int_ceilingz()) if (hit.int_hitpos().Z < hit.hitWall->nextSector()->int_ceilingz())
{ {
return 0; return 0;
} }
@ -12123,13 +12140,13 @@ int InitFistAttack(PLAYER* pp)
if (hit.hitWall->lotag == TAG_WALL_BREAK) if (hit.hitWall->lotag == TAG_WALL_BREAK)
{ {
HitBreakWall(hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, plActor->user.ID); HitBreakWall(hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, plActor->user.ID);
} }
// hit non breakable wall - do sound and puff // hit non breakable wall - do sound and puff
else else
{ {
SpawnSwordSparks(pp, hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); SpawnSwordSparks(pp, hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
PlaySound(DIGI_ARMORHIT, &hit.__int_hitpos, v3df_none); PlaySound(DIGI_ARMORHIT, hit.int_hitpos(), v3df_none);
if (PlayerTakeDamage(pp, nullptr)) if (PlayerTakeDamage(pp, nullptr))
{ {
PlayerUpdateHealth(pp, -(RandomRange(2<<8)>>8)); PlayerUpdateHealth(pp, -(RandomRange(2<<8)>>8));
@ -12734,13 +12751,13 @@ int ContinueHitscan(PLAYER* pp, sectortype* sect, int x, int y, int z, short ang
if (hit.actor() == nullptr && hit.hitWall == nullptr) if (hit.actor() == nullptr && hit.hitWall == nullptr)
{ {
if (labs(hit.__int_hitpos.Z - hit.hitSector->int_ceilingz()) <= Z(1)) if (labs(hit.int_hitpos().Z - hit.hitSector->int_ceilingz()) <= Z(1))
{ {
hit.__int_hitpos.Z += Z(16); hit.__int_hitpos.Z += Z(16);
if ((hit.hitSector->ceilingstat & CSTAT_SECTOR_SKY)) if ((hit.hitSector->ceilingstat & CSTAT_SECTOR_SKY))
return 0; return 0;
} }
else if (labs(hit.__int_hitpos.Z - hit.hitSector->int_floorz()) <= Z(1)) else if (labs(hit.int_hitpos().Z - hit.hitSector->int_floorz()) <= Z(1))
{ {
} }
} }
@ -12751,7 +12768,7 @@ int ContinueHitscan(PLAYER* pp, sectortype* sect, int x, int y, int z, short ang
{ {
if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY)) if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY))
{ {
if (hit.__int_hitpos.Z < hit.hitWall->nextSector()->int_ceilingz()) if (hit.int_hitpos().Z < hit.hitWall->nextSector()->int_ceilingz())
{ {
return 0; return 0;
} }
@ -12760,11 +12777,11 @@ int ContinueHitscan(PLAYER* pp, sectortype* sect, int x, int y, int z, short ang
if (hit.hitWall->lotag == TAG_WALL_BREAK) if (hit.hitWall->lotag == TAG_WALL_BREAK)
{ {
HitBreakWall(hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, ang, actor->user.ID); HitBreakWall(hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ang, actor->user.ID);
return 0; return 0;
} }
QueueHole(hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z); QueueHole(hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z);
} }
// hit a sprite? // hit a sprite?
@ -12784,7 +12801,7 @@ int ContinueHitscan(PLAYER* pp, sectortype* sect, int x, int y, int z, short ang
return 0; return 0;
} }
if (BulletHitSprite(pp->actor, hit.actor(), hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, 0)) if (BulletHitSprite(pp->actor, hit.actor(), hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, 0))
return 0; return 0;
// hit a switch? // hit a switch?
@ -12794,7 +12811,7 @@ int ContinueHitscan(PLAYER* pp, sectortype* sect, int x, int y, int z, short ang
} }
} }
auto j = SpawnShotgunSparks(pp, hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, ang); auto j = SpawnShotgunSparks(pp, hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ang);
DoHitscanDamage(j, hit.actor()); DoHitscanDamage(j, hit.actor());
return 0; return 0;
@ -12867,7 +12884,7 @@ int InitShotgun(PLAYER* pp)
if (hit.actor() == nullptr && hit.hitWall == nullptr) if (hit.actor() == nullptr && hit.hitWall == nullptr)
{ {
if (labs(hit.__int_hitpos.Z - hit.hitSector->int_ceilingz()) <= Z(1)) if (labs(hit.int_hitpos().Z - hit.hitSector->int_ceilingz()) <= Z(1))
{ {
hit.__int_hitpos.Z += Z(16); hit.__int_hitpos.Z += Z(16);
cstat |= (CSTAT_SPRITE_YFLIP); cstat |= (CSTAT_SPRITE_YFLIP);
@ -12878,20 +12895,20 @@ int InitShotgun(PLAYER* pp)
if (SectorIsUnderwaterArea(hit.hitSector)) if (SectorIsUnderwaterArea(hit.hitSector))
{ {
WarpToSurface(&hit.hitSector, &hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z); WarpToSurface(&hit.hitSector, &hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z);
ContinueHitscan(pp, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, ndaang, xvect, yvect, zvect); ContinueHitscan(pp, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ndaang, xvect, yvect, zvect);
continue; continue;
} }
} }
else if (labs(hit.__int_hitpos.Z - hit.hitSector->int_floorz()) <= Z(1)) else if (labs(hit.int_hitpos().Z - hit.hitSector->int_floorz()) <= Z(1))
{ {
if ((hit.hitSector->extra & SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE) if ((hit.hitSector->extra & SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE)
{ {
SpawnSplashXY(hit.__int_hitpos.X,hit.__int_hitpos.Y,hit.__int_hitpos.Z,hit.hitSector); SpawnSplashXY(hit.int_hitpos().X,hit.int_hitpos().Y,hit.int_hitpos().Z,hit.hitSector);
if (SectorIsDiveArea(hit.hitSector)) if (SectorIsDiveArea(hit.hitSector))
{ {
WarpToUnderwater(&hit.hitSector, &hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z); WarpToUnderwater(&hit.hitSector, &hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z);
ContinueHitscan(pp, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, ndaang, xvect, yvect, zvect); ContinueHitscan(pp, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ndaang, xvect, yvect, zvect);
} }
continue; continue;
@ -12905,7 +12922,7 @@ int InitShotgun(PLAYER* pp)
{ {
if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY)) if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY))
{ {
if (hit.__int_hitpos.Z < hit.hitWall->nextSector()->int_ceilingz()) if (hit.int_hitpos().Z < hit.hitWall->nextSector()->int_ceilingz())
{ {
continue; continue;
} }
@ -12914,11 +12931,11 @@ int InitShotgun(PLAYER* pp)
if (hit.hitWall->lotag == TAG_WALL_BREAK) if (hit.hitWall->lotag == TAG_WALL_BREAK)
{ {
HitBreakWall(hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, ndaang, actor->user.ID); HitBreakWall(hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ndaang, actor->user.ID);
continue; continue;
} }
QueueHole(hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z); QueueHole(hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z);
} }
// hit a sprite? // hit a sprite?
@ -12950,7 +12967,7 @@ int InitShotgun(PLAYER* pp)
continue; continue;
} }
if (BulletHitSprite(pp->actor, hitActor, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, SHOTGUN_SMOKE)) if (BulletHitSprite(pp->actor, hitActor, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, SHOTGUN_SMOKE))
continue; continue;
// hit a switch? // hit a switch?
@ -12960,7 +12977,7 @@ int InitShotgun(PLAYER* pp)
} }
} }
auto j = SpawnShotgunSparks(pp, hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, ndaang); auto j = SpawnShotgunSparks(pp, hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ndaang);
DoHitscanDamage(j, hit.actor()); DoHitscanDamage(j, hit.actor());
} }
@ -15196,7 +15213,7 @@ int InitUzi(PLAYER* pp)
// check to see what you hit // check to see what you hit
if (hit.actor() == nullptr && hit.hitWall == nullptr) if (hit.actor() == nullptr && hit.hitWall == nullptr)
{ {
if (labs(hit.__int_hitpos.Z - hit.hitSector->int_ceilingz()) <= Z(1)) if (labs(hit.int_hitpos().Z - hit.hitSector->int_ceilingz()) <= Z(1))
{ {
hit.__int_hitpos.Z += Z(16); hit.__int_hitpos.Z += Z(16);
cstat |= (CSTAT_SPRITE_YFLIP); cstat |= (CSTAT_SPRITE_YFLIP);
@ -15207,20 +15224,20 @@ int InitUzi(PLAYER* pp)
if (SectorIsUnderwaterArea(hit.hitSector)) if (SectorIsUnderwaterArea(hit.hitSector))
{ {
WarpToSurface(&hit.hitSector, &hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z); WarpToSurface(&hit.hitSector, &hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z);
ContinueHitscan(pp, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, xvect, yvect, zvect); ContinueHitscan(pp, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, xvect, yvect, zvect);
return 0; return 0;
} }
} }
else if (labs(hit.__int_hitpos.Z - hit.hitSector->int_floorz()) <= Z(1)) else if (labs(hit.int_hitpos().Z - hit.hitSector->int_floorz()) <= Z(1))
{ {
if ((hit.hitSector->extra & SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE) if ((hit.hitSector->extra & SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE)
{ {
SpawnSplashXY(hit.__int_hitpos.X,hit.__int_hitpos.Y,hit.__int_hitpos.Z,hit.hitSector); SpawnSplashXY(hit.int_hitpos().X,hit.int_hitpos().Y,hit.int_hitpos().Z,hit.hitSector);
if (SectorIsDiveArea(hit.hitSector)) if (SectorIsDiveArea(hit.hitSector))
{ {
WarpToUnderwater(&hit.hitSector, &hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z); WarpToUnderwater(&hit.hitSector, &hit.__int_hitpos.X, &hit.__int_hitpos.Y, &hit.__int_hitpos.Z);
ContinueHitscan(pp, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, xvect, yvect, zvect); ContinueHitscan(pp, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, xvect, yvect, zvect);
return 0; return 0;
} }
@ -15235,7 +15252,7 @@ int InitUzi(PLAYER* pp)
{ {
if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY)) if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY))
{ {
if (hit.__int_hitpos.Z < hit.hitWall->nextSector()->int_ceilingz()) if (hit.int_hitpos().Z < hit.hitWall->nextSector()->int_ceilingz())
{ {
return 0; return 0;
} }
@ -15245,11 +15262,11 @@ int InitUzi(PLAYER* pp)
if (hit.hitWall->lotag == TAG_WALL_BREAK) if (hit.hitWall->lotag == TAG_WALL_BREAK)
{ {
HitBreakWall(hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, actor->user.ID); HitBreakWall(hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, actor->user.ID);
return 0; return 0;
} }
QueueHole(hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z); QueueHole(hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z);
} }
// hit a sprite? // hit a sprite?
@ -15281,7 +15298,7 @@ int InitUzi(PLAYER* pp)
return 0; return 0;
} }
if (BulletHitSprite(pp->actor, hitActor, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, 0)) if (BulletHitSprite(pp->actor, hitActor, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, 0))
return 0; return 0;
// hit a switch? // hit a switch?
@ -15292,7 +15309,7 @@ int InitUzi(PLAYER* pp)
} }
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, 0); auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
actorNew->spr.shade = -40; actorNew->spr.shade = -40;
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT; actorNew->spr.xrepeat = UZI_SMOKE_REPEAT;
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT; actorNew->spr.yrepeat = UZI_SMOKE_REPEAT;
@ -15303,7 +15320,7 @@ int InitUzi(PLAYER* pp)
HitscanSpriteAdjust(actorNew, hit.hitWall); HitscanSpriteAdjust(actorNew, hit.hitWall);
DoHitscanDamage(actorNew, hit.actor()); DoHitscanDamage(actorNew, hit.actor());
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, 0); actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
actorNew->spr.shade = -40; actorNew->spr.shade = -40;
actorNew->spr.xrepeat = UZI_SPARK_REPEAT; actorNew->spr.xrepeat = UZI_SPARK_REPEAT;
@ -15685,7 +15702,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYER* pp)
if (hit.actor() == nullptr && hit.hitWall == nullptr) if (hit.actor() == nullptr && hit.hitWall == nullptr)
{ {
if (labs(hit.__int_hitpos.Z - hit.hitSector->int_ceilingz()) <= Z(1)) if (labs(hit.int_hitpos().Z - hit.hitSector->int_ceilingz()) <= Z(1))
{ {
hit.__int_hitpos.Z += Z(16); hit.__int_hitpos.Z += Z(16);
cstat |= (CSTAT_SPRITE_YFLIP); cstat |= (CSTAT_SPRITE_YFLIP);
@ -15693,11 +15710,11 @@ int InitSobjMachineGun(DSWActor* actor, PLAYER* pp)
if ((hit.hitSector->ceilingstat & CSTAT_SECTOR_SKY)) if ((hit.hitSector->ceilingstat & CSTAT_SECTOR_SKY))
return 0; return 0;
} }
else if (labs(hit.__int_hitpos.Z - hit.hitSector->int_floorz()) <= Z(1)) else if (labs(hit.int_hitpos().Z - hit.hitSector->int_floorz()) <= Z(1))
{ {
if ((hit.hitSector->extra & SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE) if ((hit.hitSector->extra & SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE)
{ {
SpawnSplashXY(hit.__int_hitpos.X,hit.__int_hitpos.Y,hit.__int_hitpos.Z,hit.hitSector); SpawnSplashXY(hit.int_hitpos().X,hit.int_hitpos().Y,hit.int_hitpos().Z,hit.hitSector);
return 0; return 0;
} }
} }
@ -15711,7 +15728,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYER* pp)
if (hitActor->spr.lotag == TAG_SPRITE_HIT_MATCH) if (hitActor->spr.lotag == TAG_SPRITE_HIT_MATCH)
{ {
// spawn sparks here and pass the sprite as SO_MISSILE // spawn sparks here and pass the sprite as SO_MISSILE
spark = SpawnBoatSparks(pp, hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); spark = SpawnBoatSparks(pp, hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
spark->user.Flags2 |= SPR2_SO_MISSILE; spark->user.Flags2 |= SPR2_SO_MISSILE;
if (MissileHitMatch(spark, -1, hit.actor())) if (MissileHitMatch(spark, -1, hit.actor()))
return 0; return 0;
@ -15724,7 +15741,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYER* pp)
return 0; return 0;
} }
if (BulletHitSprite(pp->actor, hit.actor(), hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, 0)) if (BulletHitSprite(pp->actor, hit.actor(), hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, 0))
return 0; return 0;
// hit a switch? // hit a switch?
@ -15734,7 +15751,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYER* pp)
} }
} }
spark = SpawnBoatSparks(pp, hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); spark = SpawnBoatSparks(pp, hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
DoHitscanDamage(spark, hit.actor()); DoHitscanDamage(spark, hit.actor());
return 0; return 0;
@ -16066,7 +16083,7 @@ int InitTurretMgun(SECTOR_OBJECT* sop)
if (hit.actor() == nullptr && hit.hitWall == nullptr) if (hit.actor() == nullptr && hit.hitWall == nullptr)
{ {
if (labs(hit.__int_hitpos.Z - hit.hitSector->int_ceilingz()) <= Z(1)) if (labs(hit.int_hitpos().Z - hit.hitSector->int_ceilingz()) <= Z(1))
{ {
hit.__int_hitpos.Z += Z(16); hit.__int_hitpos.Z += Z(16);
cstat |= (CSTAT_SPRITE_YFLIP); cstat |= (CSTAT_SPRITE_YFLIP);
@ -16074,11 +16091,11 @@ int InitTurretMgun(SECTOR_OBJECT* sop)
if ((hit.hitSector->ceilingstat & CSTAT_SECTOR_SKY)) if ((hit.hitSector->ceilingstat & CSTAT_SECTOR_SKY))
continue; continue;
} }
else if (labs(hit.__int_hitpos.Z - hit.hitSector->int_floorz()) <= Z(1)) else if (labs(hit.int_hitpos().Z - hit.hitSector->int_floorz()) <= Z(1))
{ {
if ((hit.hitSector->extra & SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE) if ((hit.hitSector->extra & SECTFX_LIQUID_MASK) != SECTFX_LIQUID_NONE)
{ {
SpawnSplashXY(hit.__int_hitpos.X,hit.__int_hitpos.Y,hit.__int_hitpos.Z,hit.hitSector); SpawnSplashXY(hit.int_hitpos().X,hit.int_hitpos().Y,hit.int_hitpos().Z,hit.hitSector);
continue; continue;
} }
} }
@ -16091,7 +16108,7 @@ int InitTurretMgun(SECTOR_OBJECT* sop)
{ {
if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY)) if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY))
{ {
if (hit.__int_hitpos.Z < hit.hitWall->nextSector()->int_ceilingz()) if (hit.int_hitpos().Z < hit.hitWall->nextSector()->int_ceilingz())
{ {
return 0; return 0;
} }
@ -16100,11 +16117,11 @@ int InitTurretMgun(SECTOR_OBJECT* sop)
if (hit.hitWall->lotag == TAG_WALL_BREAK) if (hit.hitWall->lotag == TAG_WALL_BREAK)
{ {
HitBreakWall(hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, 0); HitBreakWall(hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
continue; continue;
} }
QueueHole(hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z); QueueHole(hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z);
} }
// hit a sprite? // hit a sprite?
@ -16124,7 +16141,7 @@ int InitTurretMgun(SECTOR_OBJECT* sop)
continue; continue;
} }
if (BulletHitSprite(actor, hit.actor(), hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, 0)) if (BulletHitSprite(actor, hit.actor(), hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, 0))
continue; continue;
// hit a switch? // hit a switch?
@ -16135,7 +16152,7 @@ int InitTurretMgun(SECTOR_OBJECT* sop)
} }
auto j = SpawnTurretSparks(hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang); auto j = SpawnTurretSparks(hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang);
DoHitscanDamage(j, hit.actor()); DoHitscanDamage(j, hit.actor());
} }
} }
@ -16224,7 +16241,7 @@ int InitEnemyUzi(DSWActor* actor)
{ {
if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY)) if ((hit.hitWall->nextSector()->ceilingstat & CSTAT_SECTOR_SKY))
{ {
if (hit.__int_hitpos.Z < hit.hitWall->nextSector()->int_ceilingz()) if (hit.int_hitpos().Z < hit.hitWall->nextSector()->int_ceilingz())
{ {
return 0; return 0;
} }
@ -16233,20 +16250,20 @@ int InitEnemyUzi(DSWActor* actor)
if (hit.hitWall->lotag == TAG_WALL_BREAK) if (hit.hitWall->lotag == TAG_WALL_BREAK)
{ {
HitBreakWall(hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, actor->user.ID); HitBreakWall(hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, actor->user.ID);
return 0; return 0;
} }
QueueHole(hit.hitSector, hit.hitWall, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z); QueueHole(hit.hitSector, hit.hitWall, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z);
} }
if (hit.actor() != nullptr) if (hit.actor() != nullptr)
{ {
if (BulletHitSprite(actor, hit.actor(), hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, 0)) if (BulletHitSprite(actor, hit.actor(), hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, 0))
return 0; return 0;
} }
auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE+2, s_UziSmoke, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, 0); auto actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE+2, s_UziSmoke, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
actorNew->spr.shade = -40; actorNew->spr.shade = -40;
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT; actorNew->spr.xrepeat = UZI_SMOKE_REPEAT;
@ -16262,7 +16279,7 @@ int InitEnemyUzi(DSWActor* actor)
actorNew->spr.clipdist = 32L >> 2; actorNew->spr.clipdist = 32L >> 2;
actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, 0); actorNew = SpawnActor(STAT_MISSILE, UZI_SMOKE, s_UziSmoke, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
actorNew->spr.shade = -40; actorNew->spr.shade = -40;
actorNew->spr.xrepeat = UZI_SMOKE_REPEAT; actorNew->spr.xrepeat = UZI_SMOKE_REPEAT;
actorNew->spr.yrepeat = UZI_SMOKE_REPEAT; actorNew->spr.yrepeat = UZI_SMOKE_REPEAT;
@ -16273,7 +16290,7 @@ int InitEnemyUzi(DSWActor* actor)
HitscanSpriteAdjust(actorNew, hit.hitWall); HitscanSpriteAdjust(actorNew, hit.hitWall);
DoHitscanDamage(actorNew, hit.actor()); DoHitscanDamage(actorNew, hit.actor());
actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, daang, 0); actorNew = SpawnActor(STAT_MISSILE, UZI_SPARK, s_UziSpark, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, daang, 0);
actorNew->spr.shade = -40; actorNew->spr.shade = -40;
actorNew->spr.xrepeat = UZI_SPARK_REPEAT; actorNew->spr.xrepeat = UZI_SPARK_REPEAT;
@ -17671,7 +17688,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
return nullptr; return nullptr;
const int WALLBLOOD_DIST_MAX = 2500; const int WALLBLOOD_DIST_MAX = 2500;
if (Distance(hit.__int_hitpos.X, hit.__int_hitpos.Y, actor->int_pos().X, actor->int_pos().Y) > WALLBLOOD_DIST_MAX) if (Distance(hit.int_hitpos().X, hit.int_hitpos().Y, actor->int_pos().X, actor->int_pos().Y) > WALLBLOOD_DIST_MAX)
return nullptr; return nullptr;
// hit a sprite? // hit a sprite?
@ -17695,22 +17712,22 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
if (rndnum > 768) if (rndnum > 768)
{ {
WallBloodQueue[WallBloodQueueHead] = spawnedActor = WallBloodQueue[WallBloodQueueHead] = spawnedActor =
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD1, s_WallBlood1, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, ang, 0); SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD1, s_WallBlood1, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ang, 0);
} }
else if (rndnum > 512) else if (rndnum > 512)
{ {
WallBloodQueue[WallBloodQueueHead] = spawnedActor = WallBloodQueue[WallBloodQueueHead] = spawnedActor =
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD2, s_WallBlood2, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, ang, 0); SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD2, s_WallBlood2, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ang, 0);
} }
else if (rndnum > 128) else if (rndnum > 128)
{ {
WallBloodQueue[WallBloodQueueHead] = spawnedActor = WallBloodQueue[WallBloodQueueHead] = spawnedActor =
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD3, s_WallBlood3, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, ang, 0); SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD3, s_WallBlood3, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ang, 0);
} }
else else
{ {
WallBloodQueue[WallBloodQueueHead] = spawnedActor = WallBloodQueue[WallBloodQueueHead] = spawnedActor =
SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD4, s_WallBlood4, hit.hitSector, hit.__int_hitpos.X, hit.__int_hitpos.Y, hit.__int_hitpos.Z, ang, 0); SpawnActor(STAT_WALLBLOOD_QUEUE, WALLBLOOD4, s_WallBlood4, hit.hitSector, hit.int_hitpos().X, hit.int_hitpos().Y, hit.int_hitpos().Z, ang, 0);
} }
WallBloodQueueHead = (WallBloodQueueHead+1) & (MAX_WALLBLOOD_QUEUE-1); WallBloodQueueHead = (WallBloodQueueHead+1) & (MAX_WALLBLOOD_QUEUE-1);
@ -17723,7 +17740,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
spawnedActor->spr.extra = 0; spawnedActor->spr.extra = 0;
spawnedActor->spr.clipdist = 0; spawnedActor->spr.clipdist = 0;
spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0; spawnedActor->spr.xoffset = spawnedActor->spr.yoffset = 0;
spawnedActor->set_int_pos(hit.__int_hitpos); spawnedActor->set_int_pos(hit.int_hitpos());
spawnedActor->spr.shade -= 5; // Brighten it up just a bit spawnedActor->spr.shade -= 5; // Brighten it up just a bit
spawnedActor->tempwall = hit.hitWall; // pass hitinfo.wall spawnedActor->tempwall = hit.hitWall; // pass hitinfo.wall