- floatified ThrowGrenade

This commit is contained in:
Christoph Oelckers 2022-09-10 22:39:40 +02:00
parent a043c7fa4d
commit 1dff710a23
4 changed files with 5 additions and 5 deletions

View file

@ -92,7 +92,7 @@ void FuncFishLimb(int a, int b, int c);
enum { kMaxGrenades = 50 };
void BuildGrenade(int nPlayer);
void ThrowGrenade(int nPlayer, int edx, int ebx, int ecx, int push1);
void ThrowGrenade(int nPlayer, double ecx, int push1);
void FuncGrenade(int, int, int, int);
// gun

View file

@ -45,7 +45,7 @@ void BounceGrenade(DExhumedActor* pActor, DAngle nAngle)
D3PlayFX(StaticSound[kSound3], pActor);
}
void ThrowGrenade(int nPlayer, int, int, int ecx, int push1)
void ThrowGrenade(int nPlayer, double dz, int push1)
{
if (PlayerList[nPlayer].pPlayerGrenade == nullptr)
return;
@ -75,7 +75,7 @@ void ThrowGrenade(int nPlayer, int, int, int ecx, int push1)
DVector2 vec = nAngle.ToVector() * pPlayerActor->fClipdist() *2; // == << 14 + 3 + 2 - 18
auto nMov = movesprite_(pActor, FloatToFixed<18>(vec.X), FloatToFixed<18>(vec.Y), ecx, 0, 0, CLIPMASK1);
auto nMov = movesprite(pActor, vec, dz, 0, CLIPMASK1);
if (nMov.type == kHitWall)
{
nAngle = GetWallNormal(nMov.hitWall);

View file

@ -804,7 +804,7 @@ loc_flag:
case kWeaponGrenade:
{
ThrowGrenade(nPlayer, ebp, ebx, nHeight * zworldtoint - 2560, FixedToInt(PlayerList[nLocalPlayer].horizon.horiz.asq16()));
ThrowGrenade(nPlayer, nHeight - 10, FixedToInt(PlayerList[nLocalPlayer].horizon.horiz.asq16()));
break;
}
case kWeaponStaff:

View file

@ -423,7 +423,7 @@ void StartDeathSeq(int nPlayer, int nVal)
if (PlayerList[nPlayer].pPlayerGrenade)
{
ThrowGrenade(nPlayer, 0, 0, 0, -10000);
ThrowGrenade(nPlayer, 0, -10000);
}
else
{