mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 18:42:26 +00:00
- floatified return value of hits()
This commit is contained in:
parent
1111251887
commit
9591325876
8 changed files with 12 additions and 12 deletions
|
@ -5029,7 +5029,7 @@ void alterang(int ang, DDukeActor* actor, int playernum)
|
|||
{
|
||||
DAngle add = DAngle22_5 * ((krand() & 256)? 1 : -1);
|
||||
actor->spr.angle += add;
|
||||
if (hits(actor) < 844)
|
||||
if (hits(actor) < 51.25)
|
||||
actor->spr.angle -= add;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ int setanimation(sectortype* animsect, int animtype, sectortype* animtarget, dou
|
|||
void dofurniture(walltype* wallNum, sectortype* sectnum, int playerNum);
|
||||
void dotorch();
|
||||
int hitawall(player_struct* pl, walltype** hitWall);
|
||||
int hits(DDukeActor* snum);
|
||||
double hits(DDukeActor* snum);
|
||||
|
||||
DDukeActor* LocateTheLocator(int n, sectortype* sectnum);
|
||||
void clearcamera(player_struct* ps);
|
||||
|
|
|
@ -159,7 +159,7 @@ void tracers(const DVector3& start, const DVector3& dest, int n)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
int hits(DDukeActor* actor)
|
||||
double hits(DDukeActor* actor)
|
||||
{
|
||||
int zoff;
|
||||
HitInfo hit{};
|
||||
|
@ -169,7 +169,7 @@ int hits(DDukeActor* actor)
|
|||
|
||||
auto pos = actor->int_pos();
|
||||
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)) * inttoworld;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
|
@ -2261,8 +2261,8 @@ static void operateweapon(int snum, ESyncBits actions)
|
|||
spawned->spr.pos.Z += 8;
|
||||
}
|
||||
|
||||
k = hits(pact);
|
||||
if (k < 512)
|
||||
double hd = hits(pact);
|
||||
if (hd < 32)
|
||||
{
|
||||
spawned->spr.angle += DAngle180;
|
||||
spawned->vel *= 1./3.;
|
||||
|
|
|
@ -2764,8 +2764,8 @@ static void operateweapon(int snum, ESyncBits actions, sectortype* psectp)
|
|||
spawned->spr.pos.Z += 8;
|
||||
}
|
||||
|
||||
k = hits(p->GetActor());
|
||||
if (k < 512)
|
||||
int hd = hits(p->GetActor());
|
||||
if (hd < 32)
|
||||
{
|
||||
spawned->spr.angle += DAngle180;
|
||||
spawned->vel *= 1./3.;
|
||||
|
|
|
@ -360,8 +360,8 @@ void operateweapon_ww(int snum, ESyncBits actions)
|
|||
j->spr.pos.Z += 8;
|
||||
}
|
||||
|
||||
k = hits(p->GetActor());
|
||||
if (k < 512)
|
||||
int hd = hits(p->GetActor());
|
||||
if (hd < 32)
|
||||
{
|
||||
j->spr.angle += DAngle180;
|
||||
j->vel *= 1./3.;
|
||||
|
|
|
@ -1733,7 +1733,7 @@ void checksectors_d(int snum)
|
|||
}
|
||||
|
||||
if (near.hitWall == nullptr && near.hitSector == nullptr && near.actor() == nullptr)
|
||||
if (abs(hits(p->GetActor())) < 512)
|
||||
if (hits(p->GetActor()) < 32)
|
||||
{
|
||||
if ((krand() & 255) < 16)
|
||||
S_PlayActorSound(DUKE_SEARCH2, pact);
|
||||
|
|
|
@ -2671,7 +2671,7 @@ void checksectors_r(int snum)
|
|||
if (!PlayerInput(snum, SB_OPEN)) return;
|
||||
|
||||
if (near.hitWall == nullptr && near.hitSector == nullptr && near.actor() == nullptr)
|
||||
if (abs(hits(p->GetActor())) < 512)
|
||||
if (hits(p->GetActor()) < 32)
|
||||
{
|
||||
if ((krand() & 255) < 16)
|
||||
S_PlayActorSound(DUKE_SEARCH2, pact);
|
||||
|
|
Loading…
Reference in a new issue