mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- Blood: Floatified ActionScan()
.
This commit is contained in:
parent
b8b5fe9162
commit
ef03e64025
2 changed files with 8 additions and 9 deletions
|
@ -41,6 +41,10 @@ inline int HitScan(DBloodActor* pSprite, double z, int dx, int dy, int dz, unsig
|
|||
{
|
||||
return HitScan(pSprite, int(z * zworldtoint), dx, dy, dz, nMask, a8);
|
||||
}
|
||||
inline int HitScan(DBloodActor* pSprite, double z, const DVector3& pos, unsigned int nMask, int a8)
|
||||
{
|
||||
return HitScan(pSprite, int(z * zworldtoint), int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * worldtoint), nMask, a8);
|
||||
}
|
||||
int VectorScan(DBloodActor* pSprite, int nOffset, int nZOffset, int dx, int dy, int dz, int nRange, int ac);
|
||||
void GetZRange(DBloodActor* pSprite, int* ceilZ, Collision* ceilHit, int* floorZ, Collision* floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax = 0);
|
||||
void GetZRange(DBloodActor* pSprite, double* ceilZ, Collision* ceilHit, double* floorZ, Collision* floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax = 0)
|
||||
|
|
|
@ -1419,11 +1419,9 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
|
|||
{
|
||||
auto plActor = pPlayer->actor;
|
||||
*out = {};
|
||||
int x = bcos(plActor->int_ang());
|
||||
int y = bsin(plActor->int_ang());
|
||||
int z = pPlayer->slope;
|
||||
int hit = HitScan(pPlayer->actor, pPlayer->zView, x, y, z, 0x10000040, 128);
|
||||
int hitDist = (int)(plActor->spr.pos.XY() - gHitInfo.hitpos.XY()).Length();
|
||||
auto pos = DVector3(plActor->spr.angle.ToVector() * 1024., pPlayer->slope * inttoworld);
|
||||
int hit = HitScan(pPlayer->actor, pPlayer->zView, pos, 0x10000040, 128);
|
||||
double hitDist = (plActor->spr.pos.XY() - gHitInfo.hitpos.XY()).Length();
|
||||
if (hitDist < 64)
|
||||
{
|
||||
switch (hit)
|
||||
|
@ -1450,10 +1448,7 @@ int ActionScan(PLAYER* pPlayer, HitInfo* out)
|
|||
int nMass = getDudeInfo(hitactor->spr.type)->mass;
|
||||
if (nMass)
|
||||
{
|
||||
int t2 = DivScale(0xccccc, nMass, 8);
|
||||
hitactor->add_int_bvel_x(MulScale(x, t2, 16));
|
||||
hitactor->add_int_bvel_y(MulScale(y, t2, 16));
|
||||
hitactor->add_int_bvel_z(MulScale(z, t2, 16));
|
||||
hitactor->spr.pos += pos * (FixedToFloat<8>(0xccccc) / nMass);
|
||||
}
|
||||
if (hitactor->xspr.Push && !hitactor->xspr.state && !hitactor->xspr.isTriggered)
|
||||
trTriggerSprite(hitactor, kCmdSpritePush);
|
||||
|
|
Loading…
Reference in a new issue