mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 17:01:28 +00:00
- hitinfo.hitwall is also gone.
This commit is contained in:
parent
270a443c88
commit
6ae8e93de8
7 changed files with 25 additions and 33 deletions
|
@ -3436,9 +3436,9 @@ int DoPlayerWadeSuperJump(PLAYERp pp)
|
|||
bsin(pp->angle.ang.asbuild() + angs[i]), // Y vector of 3D ang
|
||||
0, &hitinfo, CLIPMASK_MISSILE); // Z vector of 3D ang
|
||||
|
||||
if (hitinfo.hitwall >= 0 && hitinfo.sector() != nullptr)
|
||||
if (hitinfo.wall() != nullptr && hitinfo.sector() != nullptr)
|
||||
{
|
||||
hitinfo.setSector(hitinfo.wall()->nextSector());
|
||||
hitinfo.hitSector = hitinfo.wall()->nextSector();
|
||||
|
||||
if (hitinfo.sector() != nullptr && labs(hitinfo.sector()->floorz - pp->posz) < Z(50))
|
||||
{
|
||||
|
@ -3782,7 +3782,7 @@ bool PlayerOnLadder(PLAYERp pp)
|
|||
else
|
||||
{
|
||||
// if you hit a wall and it is not a climb wall - forget it
|
||||
if (hitinfo.hitwall >= 0 && hitinfo.wall()->lotag != TAG_WALL_CLIMB)
|
||||
if (hitinfo.wall() != nullptr && hitinfo.wall()->lotag != TAG_WALL_CLIMB)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -956,7 +956,7 @@ int InitRipperHang(DSWActor* actor)
|
|||
|
||||
dist = Distance(sp->x, sp->y, hitinfo.pos.x, hitinfo.pos.y);
|
||||
|
||||
if (hitinfo.hitwall < 0 || dist < 2000 || dist > 7000)
|
||||
if (hitinfo.wall() == nullptr || dist < 2000 || dist > 7000)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -958,7 +958,7 @@ int InitRipper2Hang(DSWActor* actor)
|
|||
|
||||
dist = Distance(sp->x, sp->y, hitinfo.pos.x, hitinfo.pos.y);
|
||||
|
||||
if (hitinfo.hitwall < 0 || dist < 2000 || dist > 7000)
|
||||
if (hitinfo.wall() == nullptr || dist < 2000 || dist > 7000)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -2102,7 +2102,7 @@ bool NearThings(PLAYERp pp)
|
|||
if (neartagsect >= 0)
|
||||
return true;
|
||||
|
||||
if (hitinfo.hitwall >= 0)
|
||||
if (hitinfo.wall() != nullptr)
|
||||
{
|
||||
WALLp wp;
|
||||
|
||||
|
|
|
@ -201,33 +201,25 @@ inline int Collision::setFromEngine(int value)
|
|||
struct HITINFO {
|
||||
DSWActor* hitactor;
|
||||
sectortype* hitSector;
|
||||
int hitwall;
|
||||
short hitsprite;
|
||||
walltype* hitWall;
|
||||
vec3_t pos;
|
||||
|
||||
void clearObj()
|
||||
{
|
||||
pos = {};
|
||||
hitwall = -1;
|
||||
hitsprite = -1;
|
||||
hitactor = nullptr;
|
||||
hitSector = nullptr;
|
||||
hitWall = nullptr;
|
||||
}
|
||||
void set(hitdata_t* hit)
|
||||
{
|
||||
hitSector = &::sector[hit->sect];
|
||||
hitwall = hit->wall;
|
||||
hitsprite = hit->sprite;
|
||||
hitSector = hit->sect == -1? nullptr : &::sector[hit->sect];
|
||||
hitWall = hit->wall == -1 ? nullptr : &::wall[hit->wall];
|
||||
hitactor = hit->sprite >= 0 ? &swActors[hit->sprite] : nullptr;
|
||||
pos = hit->pos;
|
||||
}
|
||||
|
||||
void setSector(sectortype* sect)
|
||||
{
|
||||
hitSector = sect;
|
||||
}
|
||||
|
||||
walltype* wall() const { return hitwall == -1? nullptr : &::wall[hitwall]; }
|
||||
walltype* wall() const { return hitWall; }
|
||||
sectortype* sector() const { return hitSector; }
|
||||
};
|
||||
|
||||
|
|
|
@ -3147,7 +3147,7 @@ bool ActorTrackDecide(TRACK_POINTp tpoint, DSWActor* actor)
|
|||
if (hitinfo.hitactor != nullptr)
|
||||
return false;
|
||||
|
||||
if (hitinfo.hitwall < 0)
|
||||
if (hitinfo.wall() == nullptr)
|
||||
return false;
|
||||
|
||||
zdiff = labs(sp->z - hitinfo.wall()->nextSector()->floorz) >> 8;
|
||||
|
|
|
@ -12609,7 +12609,7 @@ int InitSwordAttack(PLAYERp pp)
|
|||
|
||||
}
|
||||
|
||||
if (hitinfo.hitwall >= 0)
|
||||
if (hitinfo.wall() != nullptr)
|
||||
{
|
||||
if (hitinfo.wall()->twoSided())
|
||||
{
|
||||
|
@ -12812,7 +12812,7 @@ int InitFistAttack(PLAYERp pp)
|
|||
}
|
||||
|
||||
|
||||
if (hitinfo.hitwall >= 0)
|
||||
if (hitinfo.wall() != nullptr)
|
||||
{
|
||||
if (hitinfo.wall()->twoSided())
|
||||
{
|
||||
|
@ -13511,7 +13511,7 @@ int ContinueHitscan(PLAYERp pp, sectortype* sect, int x, int y, int z, short ang
|
|||
if (hitinfo.sector() == nullptr)
|
||||
return 0;
|
||||
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.hitwall < 0)
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.wall() == nullptr)
|
||||
{
|
||||
if (labs(hitinfo.pos.z - hitinfo.sector()->ceilingz) <= Z(1))
|
||||
{
|
||||
|
@ -13524,7 +13524,7 @@ int ContinueHitscan(PLAYERp pp, sectortype* sect, int x, int y, int z, short ang
|
|||
}
|
||||
}
|
||||
|
||||
if (hitinfo.hitwall >= 0)
|
||||
if (hitinfo.wall() != nullptr)
|
||||
{
|
||||
if (hitinfo.wall()->twoSided())
|
||||
{
|
||||
|
@ -13647,7 +13647,7 @@ int InitShotgun(PLAYERp pp)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.hitwall < 0)
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.wall() == nullptr)
|
||||
{
|
||||
if (labs(hitinfo.pos.z - hitinfo.sector()->ceilingz) <= Z(1))
|
||||
{
|
||||
|
@ -13681,7 +13681,7 @@ int InitShotgun(PLAYERp pp)
|
|||
}
|
||||
}
|
||||
|
||||
if (hitinfo.hitwall >= 0)
|
||||
if (hitinfo.wall() != nullptr)
|
||||
{
|
||||
if (hitinfo.wall()->twoSided())
|
||||
{
|
||||
|
@ -16209,7 +16209,7 @@ int InitUzi(PLAYERp pp)
|
|||
SetVisHigh();
|
||||
|
||||
// check to see what you hit
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.hitwall < 0)
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.wall() == nullptr)
|
||||
{
|
||||
if (labs(hitinfo.pos.z - hitinfo.sector()->ceilingz) <= Z(1))
|
||||
{
|
||||
|
@ -16244,7 +16244,7 @@ int InitUzi(PLAYERp pp)
|
|||
}
|
||||
}
|
||||
|
||||
if (hitinfo.hitwall >= 0)
|
||||
if (hitinfo.wall() != nullptr)
|
||||
{
|
||||
if (hitinfo.wall()->twoSided())
|
||||
{
|
||||
|
@ -16754,7 +16754,7 @@ int InitSobjMachineGun(DSWActor* actor, PLAYERp pp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.hitwall < 0)
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.wall() == nullptr)
|
||||
{
|
||||
if (labs(hitinfo.pos.z - hitinfo.sector()->ceilingz) <= Z(1))
|
||||
{
|
||||
|
@ -17161,7 +17161,7 @@ int InitTurretMgun(SECTOR_OBJECTp sop)
|
|||
if (hitinfo.sector() == nullptr)
|
||||
continue;
|
||||
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.hitwall < 0)
|
||||
if (hitinfo.hitactor == nullptr && hitinfo.wall() == nullptr)
|
||||
{
|
||||
if (labs(hitinfo.pos.z - hitinfo.sector()->ceilingz) <= Z(1))
|
||||
{
|
||||
|
@ -17182,7 +17182,7 @@ int InitTurretMgun(SECTOR_OBJECTp sop)
|
|||
|
||||
}
|
||||
|
||||
if (hitinfo.hitwall >= 0)
|
||||
if (hitinfo.wall() != nullptr)
|
||||
{
|
||||
if (hitinfo.wall()->twoSided())
|
||||
{
|
||||
|
@ -17318,7 +17318,7 @@ int InitEnemyUzi(DSWActor* actor)
|
|||
PlaySound(DIGI_NINJAUZIATTACK, actor, v3df_none);
|
||||
}
|
||||
|
||||
if (hitinfo.hitwall >= 0)
|
||||
if (hitinfo.wall() != nullptr)
|
||||
{
|
||||
if (hitinfo.wall()->twoSided())
|
||||
{
|
||||
|
@ -18918,7 +18918,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, short ang)
|
|||
if (hitinfo.hitactor != nullptr)
|
||||
return nullptr; // Don't try to put blood on a sprite
|
||||
|
||||
if (hitinfo.hitwall >= 0) // Don't check if blood didn't hit a wall, otherwise the ASSERT fails!
|
||||
if (hitinfo.wall() != nullptr) // Don't check if blood didn't hit a wall, otherwise the ASSERT fails!
|
||||
{
|
||||
if (TestDontStick(nullptr, hitinfo.wall()))
|
||||
return nullptr;
|
||||
|
|
Loading…
Reference in a new issue