- set up proper scaling of the grenade's movement vector.

This commit is contained in:
Christoph Oelckers 2022-09-10 23:06:03 +02:00
parent 1dff710a23
commit ab3184eed8

View file

@ -41,7 +41,7 @@ void BounceGrenade(DExhumedActor* pActor, DAngle nAngle)
{ {
pActor->nTurn >>= 1; pActor->nTurn >>= 1;
pActor->vec = nAngle.ToVector() * pActor->nTurn * 32; pActor->vec = nAngle.ToVector() * pActor->nTurn / 512.;
D3PlayFX(StaticSound[kSound3], pActor); D3PlayFX(StaticSound[kSound3], pActor);
} }
@ -88,7 +88,7 @@ void ThrowGrenade(int nPlayer, double dz, int push1)
pActor->vel.Z = pPlayerActor->vel.Z; pActor->vel.Z = pPlayerActor->vel.Z;
} }
pActor->vec = nAngle.ToVector() * pActor->nTurn * 64; pActor->vec = nAngle.ToVector() * pActor->nTurn / 256;
PlayerList[nPlayer].pPlayerGrenade = nullptr; PlayerList[nPlayer].pPlayerGrenade = nullptr;
@ -276,10 +276,10 @@ void AIGrenade::Tick(RunListEvent* ev)
return; return;
} }
int zVel = pActor->int_zvel(); double zVel = pActor->vel.Z;
Gravity(pActor); Gravity(pActor);
auto nMov = movesprite_(pActor, int(pActor->vec.X * worldtoint), int(pActor->vec.Y * worldtoint), pActor->int_zvel(), pActor->native_clipdist() >> 1, pActor->native_clipdist() >> 1, CLIPMASK1); auto nMov = movesprite(pActor, pActor->vec, zVel, pActor->fClipdist() / 128., CLIPMASK1);
if (!nMov.type && !nMov.exbits) if (!nMov.type && !nMov.exbits)
return; return;
@ -298,7 +298,7 @@ void AIGrenade::Tick(RunListEvent* ev)
D3PlayFX(StaticSound[kSound3], pActor); D3PlayFX(StaticSound[kSound3], pActor);
pActor->set_int_zvel(-(zVel >> 1)); pActor->vel.Z = -zVel * 0.5;
if (pActor->vel.Z > -5) if (pActor->vel.Z > -5)
{ {